Highlights

Contents

Part II
02

Redundancy, active-active, passive

We add spare execution and state without assuming they fail independently. A spare that shares the original failure cause provides less protection than its diagram suggests. We will calculate parallel availability, divide failure domains, and check survivor capacity.

CHAPTER ATLAS / FOLLOW THE READING PATHCHAPTER ATLAS / FOLLOW THE READING PATH1Availability and SPOFs2Redundancy,active-active, passive3Graceful degradation andfault tolerance4Retries, exponentialbackoff, and jitter5Timeouts, circuitbreakers, bulkheads6Health checks andfailover7Disaster recovery, RTO,and RPO8Case study: one incident

#Section 5Redundancy and parallel paths

The score application loses a process, but another process can serve the same authenticated read. Redundancy is an additional resource that can supply the required job when another resource cannot. It helps only if the replacement has the state, credentials, capacity, and network access needed to finish that job.

For two illustrative independent paths, each with failure probability 0.001, both fail with probability 0.000001. Availability is therefore 0.999999. Read the complementary formula slowly: the alternative paths fail only when every usable alternative fails.

Aalternative=1−∏i(1−Ai).A_{\text{alternative}}=1-\prod_i(1-A_i).

Here AiA_i is the availability of alternative ii. This expression assumes any surviving alternative can satisfy the whole operation and that their failures are independent. A read replica with unacceptable lag is not such an alternative for a freshness-sensitive read.

TWO PATHS HELP ONLY IF EITHER ONE CAN SERVE THE WHOLE OPERATIONTWO PATHS HELP ONLY IF EITHER ONE CAN SERVE THE WHOLE OPERATIONpath Afresh state + authorizationpath Bfresh state + authorization1 − (1 − 0.999)² = 0.999999, if independent and sufficient
Figure 11.5Two possible paths. The probability calculation is illustrative and explicitly independent.

#Section 6Failure domains and common causes

Both application replicas restart after the same configuration change. The hardware was separate; the mistake was shared. A failure domain is the set of resources a particular incident can disable together. A host failure, a zone outage, and an invalid global configuration have different domains.

Suppose the two independent paths from the previous section still share a dependency with illustrative availability 0.999. The combined model is 0.999 times 0.999999, giving 0.998999001. The shared dependency dominates the pair’s smaller independent failure probability. Merely drawing the application boxes apart does not remove it.

THREE ZONES, ONE CONFIGURATION: A BAD PUSH TAKES DOWN ALL OF THEMTHREE ZONES, ONE CONFIGURATION: A BAD PUSH TAKES DOWN ALL OF THEMshared configzone Azone Bzone C0.999 × 0.999999 = 0.998999001: the shared part dominates
Figure 11.6Configuration is a common dependency even when the execution hosts differ.

Write the incident beside each boundary: host crash, lost zone network, expired credential, bad binary, overloaded database. Then decide which boundary contains it. Staged deployment, independent credentials, and bounded configuration rollout may help against software causes that geographic replication does not solve.

#Section 7Spare capacity after failure

Heron’s illustrative reliability variant uses four application replicas, each assumed to sustain 350 requests per second for this workload. With 1,000 peak requests per second, each normally receives 250. After one replica disappears, the surviving capacity is 3 times 350, or 1,050 requests per second.

The surviving per-replica load is 1,000 divided by 3, or 333.333 recurring requests per second in the even-distribution model. That is below the assumed limit but leaves only 50 requests per second of total headroom. Uneven routing, cache misses, and retries can consume that margin.

FOUR REPLICAS AT 350/S EACH: LOSE ONE AND 1,050 CAPACITY CARRIES 1,000 DEMANDFOUR REPLICAS AT 350/S EACH: LOSE ONE AND 1,050 CAPACITY CARRIES 1,000 DEMAND333.333/s333.333/s333.333/slost1,000 ÷ 3 = 333.333 of 350 each: 50/s of total headroom leftuneven routing or a cache miss storm can eat that in seconds
Figure 11.7Assumed workload-specific capacity. It is a sizing exercise, not a benchmark.

A replica that exists but is cold may not reach the assumed capacity immediately. Startup, connection establishment, state recovery, and cache warming belong in the failure test. Autoscaling can be a later response, but it cannot supply capacity before its detection and startup path completes.

#Section 8Active-active and active-passive

A second region can either serve production traffic now or wait to take over. Active-active means multiple sites accept live work. Active-passive means a standby takes ownership when the active site stops or is deliberately replaced. These words describe traffic and ownership, not a complete consistency guarantee.

In active-active, decide whether both regions can write the same score. If they can, they need a conflict rule or coordinated ownership. In active-passive, the standby needs replicated data, working secrets, a tested promotion path, and enough capacity. A powered-on standby with stale credentials is not a ready standby.

WHO SERVES TRAFFIC AND WHO MAY COMMIT WRITES ARE TWO DIFFERENT QUESTIONSWHO SERVES TRAFFIC AND WHO MAY COMMIT WRITES ARE TWO DIFFERENT QUESTIONSactive-activeboth write: need a conflict ruleactive-passivestandby must be promotable
Figure 11.8Alternative operating modes. Neither label settles replication lag or split-brain behavior.

For Heron, reads can be geographically distributed while a match has one authoritative writer. An outage may move that authority, but old writers must lose permission before new writers commit. The coordination and replication units explain that boundary; this chapter asks whether it remains usable during the incident.