Fallback Strategies
You'll learn: How to provide degraded but useful functionality when your circuit breaker is open, instead of failing completely.
The Core Idea
When a circuit breaker opens because a downstream service is failing, you don't have to throw your hands up and show users a generic error page. Instead, you can serve fallback responses—reduced functionality that keeps your system partially operational while the failing service recovers.
Think of it like a restaurant kitchen. If the grill breaks down (circuit opens), instead of closing the restaurant, you might offer a limited menu of cold sandwiches and salads. Customers still get fed, just not the full experience.
Common Fallback Approaches
Cached Responses
Serve stale data from cache instead of fresh data from the broken service. A user profile might show yesterday's follower count rather than failing completely.
Default Values
Return sensible defaults. If a recommendation service fails, show "Popular Items" instead of personalized suggestions.
Degraded Features
Disable non-critical features. If the comments service is down, hide the comments section but still show the main article.
Static Content
Serve pre-generated responses. If your dynamic pricing engine fails, fall back to standard catalog prices.
When to Use What
The right strategy depends on user impact. Payment processing might open the circuit and block entirely (no fallback—accuracy matters). But a "trending topics" widget could fall back to cached results from 15 minutes ago without much harm.
Key Takeaway: Fallback strategies transform hard failures into graceful degradation—when the circuit breaker opens, serve reduced functionality using cached data, defaults, or simplified responses rather than complete errors.