High Availability & Failover
Eliminate single points of failure and hit 99.99%+ uptime across availability zones and regions.
In plain words
High availability means the system keeps working even when parts of it break. Failover is automatically switching to a backup when the main part fails.
Think of it like…
Twin-engine aircraft: losing one engine keeps the plane flying safely to the runway instead of crashing.
Where you’ve seen it
If an AWS data center loses power, a well-designed app automatically moves traffic to another zone, and most users never notice.
Words you’ll hear
- Uptime / nines
- 99.9% ("three nines") allows about 8.8 hours of downtime per year.
- Redundancy
- Having spare copies so no single failure takes you down.
- RPO
- Recovery point objective: how much recent data you can afford to lose.
- RTO
- Recovery time objective: how quickly you must be back online.
Visual diagram
Theory & deep dive
Understanding Availability Nines, RPO, and RTO
Availability is measured in "nines": 99.9% allows ~8.8 hours of downtime per year; 99.99% allows only ~52 minutes per year. Remember series math: if your API depends on 3 sequential services that are each 99.9%, combined availability drops to 0.999³ ≈ 99.7%.
Always define RPO (Recovery Point Objective = max tolerable data loss, e.g., 0 seconds for payments) and RTO (Recovery Time Objective = max tolerable outage duration, e.g., <30 seconds).
How it works, step by step
Step 1 of 41. Audit and remove Single Points of Failure (SPOFs)
Verify every tier - DNS, Load Balancer, API pods, Cache, Queue, and Database - has at least 2 instances across separate Availability Zones.
- Baseline
- 2–3 AZs per region
- DB Failover
- Standby in diff AZ
When to use it & trade-offs
What it is
High Availability (HA) designs a system with redundant components, automated health checks, and failover across Availability Zones (AZs) or Regions to meet SLA uptime targets.
Why it matters: Hardware fails, AZ power drops, and bad deploys happen; without multi-AZ/multi-region redundancy, one outage takes down the entire business.
When to reach for it
- Deploying stateless tiers and primary/standby DBs across ≥2–3 Availability Zones
- Pinning user home regions in Active-Active setups to avoid cross-region write conflicts
- Setting clear SLOs (e.g. 99.95% availability, P99 < 200 ms) before sizing failover
When to avoid or be careful
- Claiming “99.999% uptime” casually without multi-region failover, automated rollbacks, and error budgets
- Putting primary DB and standby replica in the same physical rack or AZ
Multi-Region Disaster Recovery Tiers
Strengths: Lowest idle standby cost (only core DB snapshots/replicas exist).
Watch out: Minutes-to-hours RTO while spinning up compute and warming caches.
Strengths: Single primary write region keeps data simple; standby scales up fast on failover.
Watch out: Standby capacity sits partially underutilized during normal days.
Strengths: Zero wasted idle region; users land on nearest region automatically.
Watch out: Hardest distributed writes (regional pinning, CRDTs, or Spanner-like consensus).
Interview signals & numbers to know
When this topic comes up
- 99.99% SLA
- single point of failure
- RPO / RTO
- disaster recovery
- multi-region
Benchmarks & rules of thumb
- 99.9% (3 nines)
- ~8.76 hrs/yr downtime
- 99.99% (4 nines)
- ~52.6 min/yr downtime
- 99.999% (5 nines)
- ~5.26 min/yr downtime
- Cross-AZ RTT
- ~0.5–1.5 ms
Common mistakes & follow-ups
Common interview mistakes
- Forgetting that a cold failover region’s empty caches will melt the newly promoted database unless pre-warmed or rate-limited
- Confusing RPO (data loss window) with RTO (recovery time window)
- Overlooking non-DB SPOFs like a single NAT gateway, single Redis primary, or single third-party payment webhook
Likely interviewer follow-ups
- What happens to your database when 100% of traffic shifts to the backup region with a completely cold Redis cache?
- How do you achieve RPO ≈ 0 across two regions without sacrificing write latency for users?
- Explain Error Budgets and how SLOs balance feature velocity vs. reliability.
Knowledge check
Put it into practice
Design full architectures with AI feedback
Apply High Availability & Failover inside real High-Level Design prompts or review Q&A flashcards.