Part 6 · Reliability & Resilience
There is one assumption that separates systems that survive contact with the real world from systems that look great in a demo and collapse on a bad Tuesday: everything fails, eventually, and usually at the worst time. Disks corrupt. Processes are killed mid-write. A network cable is unplugged by a contractor. An entire region loses power. The CPU you depend on runs hot and throttles. None of this is exotic — at scale it is routine. A fleet of 10,000 machines with a generous 3-year mean-time-to-failure per machine still loses, on average, roughly one machine every two to three hours. Failure isn’t an edge case. It’s the weather.
So the first-principles question of reliability is not “how do we prevent failure?” — that’s a losing battle — but “how do we keep the system useful while parts of it are broken?” This part of the book is about engineering for that reality.
Why reliability is its own discipline
Section titled “Why reliability is its own discipline”You might think reliability is just “good engineering.” It overlaps, but it has a distinct character: it is about designing for the failure modes you cannot eliminate. A correct program that assumes the network never drops a packet is not reliable; it’s optimistic. Reliability work means deliberately introducing redundancy, timeouts, isolation, and fallback paths — machinery whose entire job is to do nothing useful until something breaks, and then to contain the damage.
That machinery is never free. Every technique in this part buys you survival and charges you something in return: extra hardware, added latency, more code paths to test, weaker consistency, or sheer operational complexity. The thread running through every page is the same trade question: what does this buy us, and what does it cost? A second data center buys you regional survival and costs you double the infrastructure plus the hard problem of keeping two copies in sync. A retry buys you resilience against a transient blip and risks turning a small outage into a self-inflicted stampede. There is no reliability technique that is purely upside.
The shape of the problem
Section titled “The shape of the problem”Failures cascade. That is the single most important thing to internalize. A slow database doesn’t just make one query slow — it ties up a connection, which ties up a thread, which fills a queue, which makes a healthy upstream service also slow, which causes its callers to time out and retry, which doubles the load on the already-dying database. A small local problem becomes a system-wide outage in seconds. Most of the techniques here exist to break that chain at some point: to fail fast, to isolate the blast radius, to shed load before it sinks everything.
one slow dependency │ ▼ threads block waiting ──► pool exhausts ──► upstream times out │ │ ▼ ▼ callers retry ◄────────────────────────── load doubles │ ▼ the whole system is down because ONE thing was slowReliability engineering is, in large part, the art of placing circuit breakers on that diagram.
The roadmap
Section titled “The roadmap”This part builds from the local to the global — from a single redundant component up to surviving the loss of an entire region:
- Redundancy & Failover — eliminating single points of failure, and the active-passive vs. active-active spectrum (plus why failover itself can hurt you).
- Timeouts, Retries & Backoff — the deceptively hard art of giving up at the right time, retrying safely, and not creating a retry storm.
- Circuit Breakers & Bulkheads — stopping cascading failure with breakers, and isolating resource pools so one leak can’t drown the ship.
- Rate Limiting — token buckets, leaky buckets, and windows; protecting a service from being overwhelmed (and being fair while doing it).
- Graceful Degradation & Load Shedding — serving a worse-but-working experience instead of an outage, and dropping work to protect the core.
- Disaster Recovery (RPO/RTO) — backups and the cost curve of surviving the loss of a whole site.
Read in order, each page assumes the one before it. By the end you’ll be able to look at any architecture and ask the reliability engineer’s reflex question: when this breaks — and it will — what happens next?
Check your understanding
Section titled “Check your understanding”- Why is “prevent all failure” the wrong goal for a large system? Reframe it correctly.
- Estimate roughly how often a 10,000-machine fleet loses a node if each machine fails about once every three years — and explain why that estimate matters.
- Walk through how a single slow dependency can take down an entire system. Where in that chain could you intervene?
- Distinguish reliability, availability, and resilience in one sentence each.
- State the recurring trade-off question this part keeps returning to, and give one example of a technique whose cost you’d weigh against its benefit.
Show answers
- “Prevent all failure” is a losing battle — at scale, failure isn’t an edge case, it’s the weather (disks corrupt, processes die mid-write, regions lose power). Reframe it as “how do we keep the system useful while parts of it are broken?” — design for the failure modes you can’t eliminate, not against failure itself.
- Roughly one machine every two to three hours: 10,000 machines with a ~3-year mean-time-to-failure means a node dies on the order of every few hours. The estimate matters because it shows failure is routine and continuous, not exotic — so it must be designed for, not treated as an exception.
- A slow database ties up a connection → which ties up a thread → which fills a queue → which makes a healthy upstream slow → whose callers time out and retry → which doubles load on the dying database. You can intervene almost anywhere on that chain: a timeout releases the thread, a circuit breaker stops calling the sick dependency, a bulkhead isolates the pool, and load shedding drops excess before it sinks everything.
- Reliability is the broad property that the system behaves correctly under stress and failure. Availability is the measurable slice — what fraction of the time it’s actually serving requests (the “nines”). Resilience emphasizes recovery — how gracefully the system absorbs a shock and returns to health.
- The recurring question is “what does this buy us, and what does it cost?” — there is no reliability technique that is purely upside. For example, a retry buys resilience against a transient blip but risks turning a small outage into a self-inflicted stampede; a second data center buys regional survival and costs double infrastructure plus the hard problem of keeping copies in sync.