Interview's MateSystem Design
Interview's Mate

System Design

Architecture & trade-offs

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
System Design topics
Lesson 24/ 31
Reliability, Security & Case Studies

High Availability & Failover

Eliminate single points of failure and hit 99.99%+ uptime across availability zones and regions.

IntermediateNines · RPO/RTO · Multi-Region3 quiz questions0/2 subtopics done
Practice in AI HLD
In plain wordsDiagramTheorySubtopics (2)Step by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice
Deep-dive subtopics (2) - 0/2 completed
Active-Active vs. Active-Passive Failover

Compare warm standby simplicity against multi-region active-active speed.

Intermediate
SLAs, SLOs & Composite Availability Math

Calculate error budgets and composite uptime across chained microservices.

Intermediate

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

Loading interactive diagram
Loading interactive exercise

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).

Key takeaway: Eliminate every single point of failure, run across ≥2–3 Availability Zones, and regularly test actual failovers.

How it works, step by step

Step 1 of 4
Topology Review

1. 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.

Multi-AZ is the baseline for 99.95%+ availability
Key numbers at this step
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

Backup & Restore / Pilot Light
Best for: Internal tools or cost-sensitive apps tolerating hours of RTO

Strengths: Lowest idle standby cost (only core DB snapshots/replicas exist).

Watch out: Minutes-to-hours RTO while spinning up compute and warming caches.

Warm Standby (Active-Passive)
Best for: Most SaaS & enterprise apps needing <5 min RTO

Strengths: Single primary write region keeps data simple; standby scales up fast on failover.

Watch out: Standby capacity sits partially underutilized during normal days.

Multi-Region Active-Active
Best for: Global consumer apps needing ~0 RTO and local read/write latency

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.
Interview tip: Always convert “high availability” into concrete Multi-AZ + RPO/RTO targets and mention warming/protecting cold caches during failover.

Knowledge check

Loading quiz

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.

Open AI HLD Practice →SD Interview Q&A
Previous topic
Real-Time Communication
Next topic
Resilience & Fault Tolerance