Designbench

Lesson 2.1 · 15 min

Availability and the nines

Compute what each nine allows, chain services together, and simulate a year of failures to see when redundancy works and when it does not.

The idea in plain words

Availability is how often your system is up when people need it. It is counted in “nines”: 99.9% sounds close to perfect but still allows almost nine hours of downtime a year.

The problem it solves

Things break: disks fail, deploys go wrong, networks drop. Users only care whether the service works when they need it, so you need a way to measure that and to design for a target.

How it works

  1. Measure availability as the share of time (or requests) that work, like 99.9%.
  2. Turn the target into allowed downtime: 99.9% leaves about 43 minutes a month.
  3. If a request needs several parts in a row, multiply their availabilities: each one can only lower the total.
  4. Add spare copies so one failure doesn’t stop the service, and make recovery fast.

Example

A request goes through a load balancer, an app server and a database, each 99.9% available. Together: 99.9% × 99.9% × 99.9% ≈ 99.7%, about 26 hours of downtime a year. Two independent app servers bring that part to 99.9999%, so the database becomes the part to fix next.

Key terms

Availability
The share of time (or of requests) the system works correctly.
The nines
99.9% is “three nines”, 99.99% is “four nines”; each extra nine means 10× less downtime.
SLA
A promise to customers about availability, often with refunds if it is missed.
Redundancy
Spare copies of a part, so one failure doesn’t stop the service.
Critical path
The parts every request needs; their availabilities multiply together.

In this lesson you'll learn

Sections

  1. Theory: the nines
  2. Theory: chains and redundancy
  3. Design: in the interview
  4. Check yourself

Cheat sheet

99.9%8h 45m/yr · 43m/30 d
99.99%52m 34s/yr · 4m 19s/30 d
SeriesA₁ × A₂ × …
n replicas (independent)1 − (1 − A)ⁿ
AMTBF ÷ (MTBF + MTTR)

The interactive simulations and the quiz load with JavaScript.