open atlas
↑ Back to track
System Design Foundations SD · 02 · 06

Availability: numbers and config reading

Read real availability math, config, and code, then do the arithmetic: an error-budget calculation, a serial-availability composition, a redundancy-sizing check, and a retry config that turns a slow dependency into an outage.

SD Senior ◷ 14 min
Level
FoundationsJuniorMiddleSenior

Availability incidents live in the numbers, not the prose: an SLO budget, a chain of dependencies multiplied together, a pool sized to N instead of N+1, a retry policy with no backoff. Read each snippet, do the arithmetic in your head, and pick the answer a senior on-call engineer would commit to.

Practise the loop you run during an availability review or an incident: locate the numbers, apply the nines/error-budget/composition math or the retry-and-timeout rules, and choose the change the arithmetic actually supports — not the one that feels reassuring.

Snippet 1 — the error-budget helper

def error_budget_minutes(slo: float, window_days: int = 28) -> float:
    # downtime allowed = (1 - SLO) * window
    return (1 - slo) * window_days * 24 * 60

print(round(error_budget_minutes(0.999), 1))   # what prints?
Quiz

What does error_budget_minutes(0.999) return over a 28-day window, and what does it mean?

Snippet 2 — the dependency chain

# a request must pass through all four to succeed
chain = {"lb": 0.999, "app": 0.999, "cache": 0.999, "db": 0.999}

avail = 1.0
for a in chain.values():
    avail *= a
print(round(avail, 4))   # what prints, and is it >= the 99.9% SLO?
Quiz

What does this print, and does the path meet a 99.9% SLO?

Snippet 3 — the redundancy config

# autoscaler / capacity config
peak_required_instances: 6     # instances needed to carry peak load
desired_instances: 6           # what we actually run
# note: "we run multiple instances, so the tier is redundant"
Quiz

The team calls this tier redundant because it runs multiple instances. Using the redundancy lesson, what's wrong and what's the fix?

Snippet 4 — the retry policy

# client calling a downstream service
RETRY_CONFIG = {
    "max_attempts": 5,
    "timeout_seconds": 30,     # per attempt
    "backoff": "none",         # retry immediately
    "jitter": False,
}
# the downstream service has just started returning slow responses
Quiz

The downstream service slows down. What does this retry policy do to it, and what's the correct configuration?

Recall before you leave
  1. 01
    How do you compute an error budget from an SLO, and what's the common nine-off-by-one error?
  2. 02
    Why does a four-link 99.9% serial path miss a 99.9% SLO, and what are the fixes?
  3. 03
    What turns a slow downstream into an outage in a retry config, and what's the safe configuration?
Recap

Every availability decision in this unit reduces to arithmetic you can read straight off the config. The error budget is (1 − SLO) × window — 99.9% over 28 days ≈ 40 minutes — and the classic bug is being off by one nine (0.01 vs 0.001, a 10× error). Path availability is the product of its serial links, so a four-link 99.9% chain is only ~99.6% and misses a 99.9% SLO; you fix it by removing hops or adding redundancy, not by editing prose. Redundancy is N+1, so desired_instances == peak_required is N — not redundant — and losing one at peak tips into the queueing collapse; you provision a spare. And a retry policy with long timeouts and immediate, un-jittered retries turns a slow dependency into a retry storm and an outage — the fix is short bounded timeouts, a retry budget, exponential backoff with jitter, circuit breakers, and idempotent-only retries. The senior habit is the same as the scalability unit: find the numbers, do the math, and choose the fix the arithmetic supports rather than the one that sounds safe.

Something unclear?

Ask a question about this lesson. Questions are anonymous and go straight to the author to make the lesson better.

shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources3
expand
  1. 01
  2. 02
  3. 03

Trademarks belong to their respective owners. Editorial reference only.