Hardware fails, networks partition, deploys go wrong and whole data centers lose power. Availability measures how much of the time a system is usable despite all that; reliability measures how consistently it does the right thing. This lesson gives you the vocabulary (nines, SLAs, SLOs, SLIs, error budgets), the math for combining components in series and in parallel, and the techniques that buy availability: redundancy, failover, multi-AZ and multi-region deployment, and disaster recovery planning with RPO and RTO.
Think of it like
A hospital's power supply
A hospital cannot lose power during surgery, so it has grid power, an automatic transfer switch, diesel generators and battery backups for critical machines. Each backup is a redundant path (parallel components); the transfer switch is failover; regular generator tests are failure drills. But if every source feeds through a single switch, that switch is a single point of failure, and the whole design is only as available as it is.
Four related but different ideas
- Availability
- The fraction of time (or of requests) for which the system is up and serving correctly. "Can I use it right now?" Expressed in nines: 99.9%, 99.99%.
- Reliability
- The probability the system performs correctly over a period without failure. "Will it keep working, and give the right answers?" Measured with MTBF and failure rates.
- Durability
- The probability that stored data is never lost. Amazon S3 is designed for 99.999999999% (eleven nines) durability, while its availability target is far lower: data can be temporarily unreachable without being lost.
- Fault tolerance
- The ability to keep operating correctly when components fail, usually through redundancy. It is a means to availability and reliability, not a metric itself.
The nines
| Availability | Downtime per year | Per month | Per week | Typical for |
|---|---|---|---|---|
| 90% (one nine) | 36.5 days | 73 hours | 16.8 hours | Batch jobs, internal tools |
| 99% (two nines) | 3.65 days | 7.3 hours | 1.68 hours | Non-critical internal services |
| 99.9% (three nines) | 8.77 hours | 43.8 minutes | 10.1 minutes | Many SaaS products |
| 99.95% | 4.38 hours | 21.9 minutes | 5.04 minutes | Typical single-region cloud SLAs |
| 99.99% (four nines) | 52.6 minutes | 4.38 minutes | 1.01 minutes | Core platforms, payments |
| 99.999% (five nines) | 5.26 minutes | 26.3 seconds | 6.05 seconds | Telecom, critical infrastructure |
SLIs, SLOs, SLAs and error budgets
- SLI (indicator)
- A measured number describing service health, ideally from the user's point of view: "fraction of requests that succeed in under 300 ms".
- SLO (objective)
- An internal target for an SLI over a window: "99.9% of requests succeed in under 300 ms over 30 days". Engineering decisions are made against SLOs.
- SLA (agreement)
- A contract with customers, with consequences (usually service credits) if missed. SLAs are set looser than SLOs so you get warning before you owe money.
- Error budget
- 1 − SLO: the amount of unreliability you are allowed. A 99.9% monthly SLO gives a budget of 0.1%, about 43 minutes or 1 in 1,000 requests.
Error budgets turn reliability into a shared, quantitative decision. While budget remains, teams ship features and take calculated risks. When a bad deploy burns the budget, the policy kicks in: freeze risky launches and spend engineering time on reliability until the budget recovers. 100% is the wrong target: it is unachievable, infinitely expensive, and users cannot tell 99.999% from 100% through their own flaky Wi-Fi.
Availability of whole systems
Real systems are chains and groups of components. Two formulas let you estimate the whole from the parts. Try different combinations in the calculator above.
In series: all must work
- A request passes through every component (LB → app → DB)
- A = A₁ × A₂ × … × Aₙ
- Always lower than the weakest component
- Two 99.9% components: 99.8%
- Ten 99.9% dependencies: 0.999¹⁰ ≈ 99.0%
In parallel: any one suffices
- Redundant replicas; the system works if at least one does
- A = 1 − (1 − A₁) × (1 − A₂) × … × (1 − Aₙ)
- Always higher than the best component
- Two 99.9% replicas: 99.9999%
- Assumes independent failures and working failover
Worked example
- 1
The design
A load balancer (99.99%), a web tier of two servers (99.9% each) and a single database (99.95%), in series.
- 2
Web tier in parallel
1 − (0.001 × 0.001) = 1 − 0.000001 = 99.9999%. Redundancy made the weak servers almost irrelevant.
- 3
Whole chain in series
0.9999 × 0.999999 × 0.9995 ≈ 0.99940, about 99.94%: roughly 5.3 hours of downtime a year. The single database dominates.
- 4
Fix the weakest link
Add a standby database with automatic failover: 1 − 0.0005² ≈ 99.99998%. Now 0.9999 × 0.999999 × 0.9999998 ≈ 99.99% (about 53 minutes a year), and the load balancer is the limit.
MTBF, MTTR and why recovery speed matters
You can raise availability by failing less often (higher MTBF) or by recovering faster (lower MTTR). Cutting MTTR from 60 minutes to 6 has the same effect as making failures 10× rarer, and is usually much cheaper: better alerting, automated failover, fast rollbacks and practiced runbooks.
Redundancy and failover
Active-active
- All replicas serve traffic simultaneously
- No idle capacity; failover is just removing a node from rotation
- Each must have headroom to absorb a failed peer's load
- For stateful data: needs conflict handling or partitioning
Active-passive
- One primary serves; a standby takes over on failure
- Simpler consistency: one writer at a time
- Standby capacity sits idle (hot, warm or cold)
- Failover takes time and must avoid split brain
- 1
Detect
Health checks and heartbeats notice the failure. Too sensitive causes false failovers; too lenient prolongs outages. See Heartbeats & Gossip Protocols.
- 2
Decide
Confirm the primary is really dead, ideally by quorum among several observers, so a network blip does not trigger a failover. See Consensus: Raft & Paxos.
- 3
Fence
Make sure the old primary cannot keep accepting writes (revoke its lease, cut it off), or you get split brain: two primaries diverging.
- 4
Promote and redirect
Promote the standby and move traffic to it via the load balancer, a virtual IP, service discovery or DNS (respecting TTLs).
- 5
Recover and fail back
Repair the old node, resync it as a standby, and fail back deliberately (or not at all).
Hunting single points of failure
- One load balancer, one database primary without a standby, one NAT gateway, one DNS provider.
- Shared dependencies hidden behind redundancy: both replicas in the same rack, zone or power circuit.
- Operational SPOFs: one person who knows how to fail over, one region for the deploy pipeline, an expired TLS certificate.
- Configuration: a bad config push applied everywhere at once takes down every replica. Roll out gradually.
Multi-AZ, multi-region and disaster recovery
Cloud regions contain several availability zones (AZs): physically separate data centers with independent power and networking, connected by low-latency links (about 1 to 2 ms). Spreading across AZs protects against a data center failure while still allowing synchronous replication. Surviving the loss of a whole region requires a second region, hundreds of kilometers away, where replication is usually asynchronous because synchronous writes would add tens of milliseconds.
- RPO (recovery point objective)
- How much data you can afford to lose, measured in time. With async replication lagging 5 seconds, a sudden region loss can lose up to 5 seconds of writes: RPO ≈ 5 s.
- RTO (recovery time objective)
- How long the service may be down before it is restored. Covers detection, decision, promotion, scaling up and traffic shift.
| DR strategy | How it works | RPO | RTO | Cost |
|---|---|---|---|---|
| Backup and restore | Periodic backups to another region; rebuild everything on disaster | Hours | Hours to days | $ |
| Pilot light | Data replicated continuously; minimal core infrastructure running, the rest provisioned on demand | Minutes | Tens of minutes | $$ |
| Warm standby | A scaled-down full copy runs in the second region; scale up on failover | Seconds to minutes | Minutes | $$$ |
| Multi-site active-active | Both regions serve live traffic; failover just shifts load | Near zero to seconds | Near zero | $$$$ |
Implementation
Compose components in series and parallel, then convert availability to allowed downtime. Assumes independent failures.
from math import prod
MINUTES_PER_YEAR = 365.25 * 24 * 60
def series(*parts: float) -> float:
"""Every component must work."""
return prod(parts)
def parallel(*parts: float) -> float:
"""At least one replica must work (independent failures, perfect failover)."""
return 1 - prod(1 - a for a in parts)
def from_mtbf(mtbf_hours: float, mttr_hours: float) -> float:
return mtbf_hours / (mtbf_hours + mttr_hours)
def downtime(availability: float) -> str:
minutes = (1 - availability) * MINUTES_PER_YEAR
return f"{availability:.5%} available, {minutes:,.1f} min/year, {minutes / 12:,.1f} min/month"
lb, web, db = 0.9999, 0.999, 0.9995
before = series(lb, parallel(web, web), db)
after = series(lb, parallel(web, web), parallel(db, db))
print("single DB: ", downtime(before)) # ~99.94%, ~316 min/year
print("DB + standby:", downtime(after)) # ~99.99%, ~53 min/year
print("MTBF 1000h, MTTR 1h:", downtime(from_mtbf(1000, 1)))Key takeaways
- Availability is uptime (can I use it?), reliability is correct operation over time, durability is not losing data; fault tolerance is how you get them.
- Each extra nine cuts allowed downtime 10×: 99.9% is ~8.8 hours a year, 99.99% is ~53 minutes.
- SLIs measure, SLOs set internal targets, SLAs are contracts; the error budget (1 − SLO) balances shipping speed against reliability.
- Series availability multiplies (always worse than the weakest part); parallel redundancy is 1 − Π(1 − Aᵢ), assuming independent failures.
- Availability = MTBF ÷ (MTBF + MTTR): faster recovery is often the cheapest way to add nines.
- Multi-AZ protects against data center failures with synchronous replication; multi-region adds disaster recovery, defined by RPO and RTO.
Common pitfalls
- Adding replicas that share a failure domain (same rack, zone, config or deploy), so they fail together.
- Forgetting that a long chain of dependencies in series erodes availability, even if each one has three nines.
- Failover without fencing, leading to split brain and divergent data.
- Long DNS TTLs that keep clients pointed at a dead region for hours.
- Never testing failover or restoring backups until a real disaster.
Interview tips
- Translate a target into downtime ("four nines is under an hour a year") and say what it implies: automatic failover, multi-AZ, no single points of failure.
- Do the series/parallel math on your own design to find the weakest link, then fix it.
- Ask for RPO and RTO before choosing between backups, warm standby and active-active.
Real-world applications
- Setting SLOs and error-budget policies for production services.
- Choosing database deployment modes (single-AZ, multi-AZ, cross-region replicas).
- Disaster recovery planning and compliance requirements.
- Evaluating vendor SLAs against your own availability target.
Test yourself
Two components, each 99% available, are connected in series. What is the overall availability?
Related topics
Finished this lesson? Track it to see your progress on the roadmap.