Reliability: recap and quiz
The module in six sentences
Section titled “The module in six sentences”- Timeouts and retries. A timeout is the caller’s limit on waiting and does not say whether the work was done; a retry cures a brief failure and, in an outage, only adds load.
- Backoff and jitter. Waiting longer after each failure spaces the retries out, and jitter stops the clients that failed together from retrying together, without reducing the number of retries.
- Retry amplification and budgets. Retries at every layer multiply, up to 64 attempts for three layers of four, and a retry budget caps them at the price of requests that fail early.
- Circuit breakers. After enough failures in a row the breaker opens and fails calls at once, then lets one probe through to learn when the dependency is back.
- Bulkheads. A pool for each dependency keeps a silent one from using up the connections that the healthy ones need.
- Failover. When a component is lost another takes the work, after a detection delay, with enough spare capacity, and with care about state.
How each one breaks
Section titled “How each one breaks”| Idea | What breaks | What you see | What helps |
|---|---|---|---|
| Timeout | Too long, or too short | Calls held for ever, or answers thrown away | A limit read from a latency percentile |
| Retry | Retried in an outage, or not safe to repeat | Several times the traffic, or work done twice | A limit, transient failures only, idempotent calls |
| Backoff | Everyone waits the same time | Waves of retries | Jitter |
| Layers | Every layer retries | Attempts multiplied: 4 × 4 × 4 = 64 | Retry at one point, and a retry budget |
| Breaker | A bad threshold, or one breaker for several parts | Healthy calls blocked, or no protection | A threshold and a pause that fit the dependency, one breaker for each part |
| Bulkhead | A pool that is too small, or none | Refused calls, or one dependency using up the rest | Sizing with Little’s Law, a timeout in each pool |
| Failover | Slow to notice, or no spare capacity | Failed requests, then overloaded survivors | Faster checks, capacity for the loss of one, a rehearsal |
A checklist for a call to a dependency
Section titled “A checklist for a call to a dependency”- What is the timeout, and where does it come from? A percentile of the dependency’s latency, and the time the user has left. (Timeouts and retries)
- Is the failure transient, and is the call safe to repeat? If not, do not retry. (Timeouts and retries)
- How long does a retry wait, and is the wait random? Capped exponential backoff with jitter. (Backoff and jitter)
- How many layers retry? Multiply their attempts, and prefer one. (Retry amplification and budgets)
- What caps the retries as a whole? A budget, and what the caller does when it is empty. (Retry amplification and budgets)
- What happens after five failures in a row? A breaker, its pause, and what the caller returns while it is open. (Circuit breakers)
- What else does this dependency share with the others? A pool, threads, an instance: give each its own share. (Bulkheads)
- What takes over when it is lost, and how long does that take to notice? And can the survivors carry the load? (Failover)
Check your understanding
Section titled “Check your understanding”Nine questions cover the whole module. Every option is explained, whether it is right or wrong.
Reliability: module quiz
This quiz needs JavaScript to check your answers.
Where this goes next
Section titled “Where this goes next”These protections limit the damage of one failure. The next module, failure engineering, looks at how failures spread from one component to the next, at overload and load shedding, and at how to test your protections on purpose. Rate limiting is the other side of the retry budget: a server saying how much it will accept. Ask this module’s questions first when you meet them: how long to wait, how many times to try, and what the caller does when the answer is no.
Your progress
Built by GhaziAlibi.
© ShardCraft. All rights reserved.