Highlights

Contents

Part I
01

Availability and SPOFs

We decide what a successful score request means before adding spare machines. A response can be reachable, wrong, late, or missing a committed update. We will separate these failures, draw their dependencies, and calculate the promise Heron actually makes.

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 1Single points of failure

A viewer opens Heron while a match is being scored. Every application replica answers health checks, but all of them need the same database. When that database stops, adding another application replica changes nothing. A single point of failure is a component whose failure alone defeats the required operation.

Draw a score read as a dependency graph. The viewer needs a reachable entry point, an application worker, and authoritative score state. Draw an upload separately because its bytes and metadata have different owners. A shared resolver, credential service, storage account, or configuration deployment can be a hidden dependency even when it never appears in the request diagram.

For the illustrative peak, Heron receives 1,000 API requests each second. If every request requires the failed database, all 1,000 lose that path. If a permitted cached score can answer a read, that operation has another path, but a score correction still needs the commit boundary. Reliability belongs to an operation and its contract, not to a list of machines.

THREE APPLICATION REPLICAS, ONE DATABASE: WHEN IT FAILS, ALL 1,000 REQUESTS/S FAILTHREE APPLICATION REPLICAS, ONE DATABASE: WHEN IT FAILS, ALL 1,000 REQUESTS/S FAILapp Aapp Bapp Cspare app copies cannotrepair required state
Figure 11.1Illustrative dependency graph. Independent application processes share one required database.

A strong interview answer names the operation, identifies the required dependencies, and asks whether a substitute preserves correctness. Replacing a database with an old cached score is acceptable only if the read contract permits that age. Returning an old score as if it were current hides failure rather than tolerating it.

#Section 2Reliability, availability, and correctness

The scorer receives a success reply, then reloads the match and sees the previous score. The server was reachable, but the operation did not meet its promise. Reliability means that the service performs its specified job under the stated conditions. Availability measures the fraction of eligible time or requests during which it meets a chosen success definition.

Write Heron’s definition before collecting percentages. A score read succeeds if the user has permission, the answer meets the freshness requirement, and the reply arrives before its deadline. A score correction succeeds only after its durable commit. A deliberate client validation error does not automatically count as a service fault, while an overloaded server that rejects a valid request usually does.

For an illustrative request-based target of 99.9%, 8,640,000 eligible daily requests allow 8,640 failures. That budget is not permission to corrupt 8,640 score changes. Integrity and availability need separate rules because a wrong successful write can survive long after an outage ends.

A SUCCESS COUNTS ONLY WHEN THE CALL IS REACHABLE, CORRECT AND ON TIMEA SUCCESS COUNTS ONLY WHEN THE CALL IS REACHABLE, CORRECT AND ON TIMEreachableconnection workscorrectright, authorized scoretimelyinside the deadlinesuccess99.9% of 8,640,000daily requests allows8,640 failures, not8,640 wrong scores
Figure 11.2The chosen operation defines success. These are requirements, not measured service values.

#Section 3Availability calculations and the two targets

A service advertises 99.99%, but a team cannot say how much outage time fits that statement. Choose an illustrative thirty-day accounting interval. Its duration is 30 times 24 times 60 times 60, giving 2,592,000 seconds. The unavailable fraction is one minus the target availability.

B=T(1−A).B=T(1-A).

Read this as the unavailable-time budget equals the total accounting time, TT, multiplied by one minus availability, AA. At 99.9%, the fraction is 0.001 and the budget is 2,592 seconds. At 99.99%, it is 0.0001 and the budget is 259.2 seconds. The tighter target leaves one tenth as much unavailable time under this definition.

IN A 30-DAY MONTH, 99.9% ALLOWS 2,592 S DOWN; 99.99% ALLOWS 259.2 SIN A 30-DAY MONTH, 99.9% ALLOWS 2,592 S DOWN; 99.99% ALLOWS 259.2 S99.9%2,592 s ≈ 43.2 min99.99%259.2 s ≈ 4.32 minB = T(1 − A) = 2,592,000 s × 0.001 or × 0.0001state the interval and what counts before quoting a percentage
Figure 11.3Computed for a thirty-day month. Planned exclusions and request-based accounting would change the definition.

A request-based target can behave differently. An outage during a quiet hour may consume little request budget but much time budget. During the final minutes of a popular match, the reverse can happen. Choose the metric that represents the promise, and keep the other metric available for diagnosis.

#Section 4Required dependencies multiply risk

The entry proxy, application, and score database each meet an illustrative availability of 99.9%. A successful uncached read requires all of them. Under an explicitly independent failure model, their joint availability is the product, not the best individual percentage.

Apath=∏iAi.A_{\text{path}}=\prod_i A_i.

Read this as the availability of a required path is the product of each required component's availability, assuming their relevant failures are independent. Multiplying 0.999 by itself for the proxy, application, and database gives 0.997002999, or 99.7002999%. Adding mandatory dependencies can therefore lower the end-to-end promise.

THREE 0.999 COMPONENTS IN SERIES: 0.999³ = 0.997002999 FOR THE PATHTHREE 0.999 COMPONENTS IN SERIES: 0.999³ = 0.997002999 FOR THE PATHproxy0.999application0.999database0.999A = 0.999 × 0.999 × 0.999 = 0.997002999only if failures are independent; shared causes break the product
Figure 11.4Independent component model, not a measured forecast. Correlated failures invalidate this product.

The independence assumption is usually the fragile part. Shared power, region, identity, software, or load can correlate failures. Do not turn this arithmetic into a guarantee. Use it to expose dependencies, then identify common causes and measure the real service. The same rule applies to optional features: if recommendations are required before returning a score, a recommendation outage has become a score outage.