Graceful degradation and failing dependencies
Decide on purpose what happens when something you depend on is down.
15 min readFail open or fail closed
When a dependency fails, you choose: fail open (skip the check and keep serving) or fail closed (refuse the request). A rate limiter usually fails open so an outage of its counter store does not take down the API; a payment check must fail closed.
Isolate slow dependencies
A slow dependency is often worse than a dead one, because it ties up threads and connections. Use timeouts on every call, retries with exponential backoff, circuit breakers that stop calling a failing service, and separate queues or pools per dependency so one bad provider cannot starve the others.
Degrade, do not disappear
Serve stale data, hide a non-essential feature, or queue work for later. Users forgive a missing recommendation widget; they do not forgive a blank page.
Key takeaways
- Choose fail-open or fail-closed per dependency, and write it down
- Timeouts, backoff and circuit breakers stop slow dependencies spreading
- Prefer stale or partial results over errors
Sign in to track lessons and earn badges.