Bird
0
0

What additional design should be added to ensure cache freshness without sacrificing availability?

hard📝 Trade-off Q8 of 15
Microservices - Resilience Patterns
A microservice architecture uses graceful degradation by returning cached data when a downstream service fails. What additional design should be added to ensure cache freshness without sacrificing availability?
ABlock user requests until cache updates
BImplement background cache refresh with fallback to stale data
CClear cache on every request
DDisable cache and always call downstream service
Step-by-Step Solution
Solution:
  1. Step 1: Understand cache freshness vs availability tradeoff

    Refreshing cache in background keeps data fresh without blocking users.
  2. Step 2: Evaluate options for availability

    Disabling cache or blocking users reduces availability; clearing cache every request is inefficient.
  3. Final Answer:

    Implement background cache refresh with fallback to stale data -> Option B
  4. Quick Check:

    Background refresh + stale fallback = Freshness + availability [OK]
Quick Trick: Refresh cache in background, serve stale if needed [OK]
Common Mistakes:
MISTAKES
  • Disabling cache harms availability
  • Blocking users reduces user experience
  • Clearing cache wastes resources

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes