Notes
The nines
Availability is the share of time the system works. Ninety-nine percent sounds great, but it's three and a half days of downtime a year. Three nines is under nine hours. Four nines is fifty-three minutes. Five nines is five minutes a year. Each extra nine costs roughly ten times more effort.
99% (two nines) 3.65 days 99.9% (three) 8.8 hours 99.95% 4.4 hours 99.99% (four) 53 minutes 99.999% (five) 5 minutes each extra nine costs roughly 10× more effort and money
SLOs
Three terms. The SLI is what you measure, like the percentage of requests that succeed in under three hundred milliseconds. The SLO is your internal target, say ninety-nine point nine percent per month. The SLA is the contract with customers, usually looser, with refunds. The gap to a hundred percent is your error budget: spend it on releases, and when it's gone, slow down and fix reliability.
- SLI: what you measure
- % of requests OK in < 300 ms
- SLO: your internal target
- 99.9% over 30 days
- SLA: the promise to customers,
- with refunds if broken (99.5%)
- error budget = 100% − SLO
- 0.1% ≈ 43 minutes a month
- budget left → ship faster
- budget gone → freeze, fix
Serial
Components in a chain multiply. If the load balancer, the app and the database are each up ninety-nine point nine percent, a request that needs all three succeeds only ninety-nine point seven percent of the time. Every dependency on the critical path lowers availability, and any single box with no backup is a single point of failure.
- request needs LB AND app AND DB
- 0.999 × 0.999 × 0.999
- = 99.7%
- every dependency you add
- to the critical path lowers
- availability
- one box with no backup =
- single point of failure
Redundancy
Redundancy works the other way. Two app servers that are each up ninety-nine percent are both down only one percent of one percent of the time, so together they're ninety-nine point nine nine. But only with health checks, automatic failover, and failures that are truly independent: different racks, different power, different availability zones.
- two app servers, each 99%:
- both down = 1% × 1% = 0.01%
- → 99.99% available
- needs: health checks,
- automatic failover,
- independent failures
- (different zones, racks, power)
Failover
When zone A fails, health checks stop sending it traffic, and the database standby in zone B is promoted. That's active-passive: a standby waits, then takes over. Active-active means every copy serves traffic all the time, so losing one just shifts load, but writes get harder. Either way, provision N plus one, so you survive losing one.
- active-passive: standby waits,
- promoted on failure
- simple; failover takes time
- active-active: all copies serve
- traffic all the time
- no idle capacity, instant
- shift; harder for writes
- run N+1: survive losing one
Real outages
Here's the uncomfortable truth: most outages are caused by changes, like bad deploys, config pushes or expired certificates, not by hardware. So availability also means canary releases and fast rollbacks, rate limits and load shedding, timeouts and circuit breakers, and graceful degradation: hide recommendations, but keep checkout working.
- most outages are changes:
- bad deploys, config pushes,
- expired certificates
- → canary releases, fast rollback
- → rate limits, load shedding
- → timeouts + circuit breakers
- → graceful degradation:
- hide recommendations,
- keep checkout working
Regions
Spreading across availability zones in one region is cheap and standard; it survives a data centre failure. Multiple regions survive a whole region going down, but you pay for replication lag, global load balancing and regular failover drills. How far to go depends on what an hour of downtime costs the business.
- multi-zone: survives a data
- centre failure; cheap, standard
- multi-region: survives a whole
- region; costly and complex
- data replication lag
- DNS / global load balancing
- failover drills
- choose by the cost of downtime
Say it like this
In an interview: state the target, say four nines, about fifty-three minutes a year. Walk your diagram and remove every single point of failure: redundant load balancers, N plus one app servers across three zones, a database standby with automatic failover. Then mention graceful degradation, canary deploys and fast rollback.
- state the target: 99.99%
- = ~53 min/year
- no single points of failure:
- LB pair, N+1 app servers
- across 3 zones
- DB primary + standby,
- automatic failover
- degrade gracefully
- canary deploys, quick rollback