Graceful degradation
Also called: degraded mode, fail soft, fallback.
Designing a service so that when a dependency fails, its core job keeps working and only the extras are dropped or simplified. The page still loads with stale, default or missing parts instead of showing an error.
The product is the core of the page; recommendations are an extra. Take Recommendations down and load the page again: the product still shows, with Popular items in place of personal picks.
Pages loaded: 0 · With a fallback: 0 · Error pages: 0
Not loaded yet. Both services are up.
Say it in a prompt
Make the product page degrade gracefully: give the recommendations, reviews and stock services a 300 ms timeout each. If recommendations fail, show the cached bestseller list; if reviews fail, hide the reviews block; if stock fails, show 'Check availability at checkout'. Only a missing product returns an error page. Vague vs precise prompt
Vague prompt
the product page shows an error when the reviews service is down, fix it Typical resultAdds a retry loop around the reviews call. The page now takes 10 seconds and then shows the same error.
Precise prompt
Degrade gracefully: give recommendations, reviews and stock a 300ms timeout each. On failure show cached bestsellers, hide reviews, and show 'Check availability at checkout'. Only a missing product returns an error page. Typical resultWhen reviews or recommendations are down, the page still loads quickly with those parts hidden or cached, and people can keep buying.
Seen on
- AWS Well-Architected Framework: Best practice REL05-BP01 asks components to keep their core function when dependencies fail, for example a store's landing page still showing everything else when the recommendations system is down.
- A search page still shows its results, without the 'people also bought' box, when the recommendations service times out.
You might describe it as
- show the page even if one part of it is broken
- hide the reviews box instead of erroring when that service is down
- keep checkout working when the extras fail
Not to be confused with
- Circuit breaker
Graceful degradation is what the user gets while a part is down; a circuit breaker is one way to notice the failure and stop calling that part.