Load/Bearing
Fundamentals · 10 of 22

Availability, redundancy and failover

Every component fails eventually. Design so that one failure costs you capacity, not the whole site.

3 min readUsed in: 11 · Four Nines, 2 · Front Page

Availability is the fraction of time, or of requests, that the system works. It's usually written in "nines", and each extra nine cuts the allowed downtime by a factor of ten.

AvailabilityDowntime per yearPer month
99% (two nines)3.65 days7.3 hours
99.9% (three nines)8.77 hours43.8 minutes
99.95%4.38 hours21.9 minutes
99.99% (four nines)52.6 minutes4.4 minutes
99.999% (five nines)5.26 minutes26 seconds

At four nines there isn't time for a person to notice, log in and fix anything. Recovery has to be automatic.

Series and parallel

When a request needs several components in a chain, their availabilities multiply, and the chain is weaker than any single link:

series: A = A₁ × A₂ × A₃ 99.9% × 99.9% × 99.9% ≈ 99.7% parallel: A = 1 − (1 − A₁) × (1 − A₂) two independent 99% servers → 1 − 0.01 × 0.01 = 99.99%

Redundancy is the parallel formula at work: two mediocre components in parallel beat one excellent one. The catch is the word independent. Two servers in the same rack, on the same power supply, running the same buggy deploy, fail together.

USERSLBpair · health checksAPP 1zone aAPP 2zone bAPP 3zone cPRIMARYzone aSTANDBYzone b
Redundancy at every tier: spare app servers across zones and a standby database that can be promoted.

Remove single points of failure

Go through the diagram box by box and ask: what happens when this one dies?

Active-passive vs active-active

Active-passive keeps a standby idle until it's needed. It's simpler, but failover takes time and the standby might not work when you finally use it. Active-active serves traffic from every copy all the time, so you know every copy works, and failure only means redistributing load. You have to keep enough headroom that the survivors can carry the whole load.

RTO and RPO

RTO (recovery time objective) is how long recovery may take. RPO (recovery point objective) is how much data you can afford to lose. A nightly backup gives you an RPO of 24 hours. Async replication gives seconds. Synchronous replication gives zero, at the cost of slower writes.

Stop failures from spreading

Practise failing

Failover paths that never run tend to be broken when you need them. Chaos engineering kills instances, adds latency and cuts off zones on purpose, in a controlled way, to prove recovery works. That's what the Four Nines level does to your design.

In the game: APP 1 crashes from 18 s to 34 s and the database primary dies from 38 s to 50 s. To stay under 0.5% errors, the remaining app servers must carry peak traffic (N+1), and a replica must be there to promote.

Interview checklist

Practise it

Level 11: Four Nines

Put this into practice against live traffic. Your progress in the game is saved in your browser.

Play level 11

Further reading