Failure engineering: recap and quiz
The module in six sentences
Section titled “The module in six sentences”- Cascading failures. A failure that makes more failures likely: lose one of three instances at 900 requests a second and the two that remain are at 113%, the queue outgrows the clients’ patience, and 71% of the requests fail.
- Overload, backpressure and load shedding. Only capacity raises how much succeeds; shedding and backpressure choose which work is refused and keep the rest timely, and adding capacity at the first bottleneck moves the bottleneck.
- Dependency failures. A dead component fails the requests whose path goes through it, 26% in the shop, and a cache, a replica or a default turns some of those paths into paths that do not.
- Gray failures. A dependency that is slow and not dead passes its health check, keeps its callers waiting and multiplies the calls to it, so it does more damage than a dead one.
- Disaster recovery. The recovery time objective and the recovery point objective are separate numbers, each bought with money or latency, and a plan that has not been exercised has guessed numbers.
- Failure injection and chaos experiments. Cause the failure on purpose, with a hypothesis, a small blast radius and a stop condition, and measure enough to see what you are losing.
How each one goes wrong
Section titled “How each one goes wrong”| Idea | How it goes wrong | What you see | What helps |
|---|---|---|---|
| Cascade | The survivors cannot carry the load, and the queue holds requests longer than clients wait | Work spent on answers nobody reads, and failures near 100% | Spare capacity for the failures you expect, cheaper work, a deadline |
| Overload | More work than capacity, and the only response is to wait | A long queue and late answers | Shed early, throttle senders, add capacity along the whole path |
| Dependency | A hard dependency with no way round | The requests that need it fail | A replica, more caching, a defined core function |
| Gray failure | The check sees healthy while the callers see slow | The same failures as a dead dependency, with long waits and doubled load | Measure what callers feel, bound the wait, limit the retries |
| Disaster recovery | Unstated or untested objectives | A recovery slower or lossier than anyone expected | Set RTO and RPO per system, back up, exercise the restore |
| Chaos experiment | A steady state that does not measure what matters | A green dashboard on a system that is losing data | A small blast radius, a stop condition, more measures |
A checklist for reviewing a design against failure
Section titled “A checklist for reviewing a design against failure”Each question points back to the lesson that answers it.
- If one instance, zone or node is lost, can the rest carry the traffic? Divide the capacity that remains by the load. (Cascading failures)
- How long can a request wait in your queues, and how long will the client? A queue longer than the client’s patience turns an overload into wasted work. (Cascading failures)
- When more arrives than you can serve, what is refused, by whom, and what do the senders do? (Overload, backpressure and load shedding)
- If you scale the first component, which one is next? (Overload, backpressure and load shedding)
- Which share of requests depends on each component, and what is the core function without it? (Dependency failures)
- Does each timeout exceed the latency you can see in a bad hour, and what does each retry add to the load? (Gray failures)
- Does a health check measure what the callers experience? (Gray failures)
- What are the RTO and RPO of each system, and when did you last restore a backup or run the failover? (Disaster recovery)
- For the next experiment, what are the steady state, the hypothesis, the blast radius and the stop condition? (Failure injection and chaos experiments)
Check your understanding
Section titled “Check your understanding”Eight questions cover the whole module. Every option is explained, whether it is right or wrong.
Failure engineering: module quiz
This quiz needs JavaScript to check your answers.
Where this goes next
Section titled “Where this goes next”The reliability module before this one gives the tools a service uses to protect itself from a failing dependency: timeouts, retries with backoff and jitter, circuit breakers and bulkheads. This module measured what happens without them, in a lab that has none. The next module takes the failure of a whole region and the data and traffic questions that come with running in several.
Your progress
Built by GhaziAlibi.
© ShardCraft. All rights reserved.