Module 5 · Distributed systemsLesson 58 of 887 minIntermediate
High availability and the nines
Availability is the share of time a system works. Parts in a chain multiply their downtime; spare copies divide it.
Start with one copy of each part and read the downtime per year. Then add a second app server, a second database and a second load balancer, and watch the nines grow.
Availability is the percentage of time a system does its job. It's usually written in nines:
| Availability | Downtime per year | Per month |
|---|---|---|
| 99% | 3.7 days | 7.3 hours |
| 99.9% | 8.8 hours | 44 minutes |
| 99.99% | 53 minutes | 4.4 minutes |
| 99.999% | 5.3 minutes | 26 seconds |
Each extra nine is ten times harder, and usually far more expensive.
Series: dependencies multiply
If a request needs A and B and C, all must be up. Overall availability is A x B x C. Three parts at 99.9% give about 99.7%. Every new required dependency (another service, a third-party API) lowers your ceiling.
Parallel: redundancy multiplies
If either of two copies can serve, the service is down only when both are. Two copies at 99% give 1 - (0.01 x 0.01) = 99.99%. That's the power of redundancy, assuming the copies fail independently, which is why they belong in different zones.
How HA systems are built
- No single points of failure: every tier has at least two copies.
- Fast failover: health checks, automatic promotion of replicas, load balancers routing around dead nodes. Availability depends on how quickly you recover, not just how rarely you fail.
- Active-active (all copies serve traffic) vs active-passive (a standby waits). Active-active uses capacity better and proves the spare works.
- Safe deploys: many outages are self-inflicted. Rolling and canary releases keep availability during changes.
Measure what users feel
Availability measured as "the server process was running" is meaningless if users got errors. Measure successful requests over total requests. That idea leads straight to SLIs and SLOs in the next module.