How do you design for high availability and disaster recovery on AWS?
Concepts
- RTO (recovery time objective): how long you may be down. RPO (recovery point objective): how much data you may lose.
- High availability handles component and AZ failures automatically within a region; disaster recovery handles losing a region or a catastrophic event (including deletion or ransomware).
Within a region (HA)
Run every tier across at least two, preferably three AZs: ALB across AZs, Auto Scaling groups or Kubernetes nodes spread across AZs, Multi-AZ RDS or Aurora, ElastiCache with replicas and automatic failover, MSK across three AZs. Stateless services, health checks and automatic replacement.
DR strategies (cost rises, RTO/RPO fall)
- Backup and restore: backups (AWS Backup, snapshots) copied to another region and account; infrastructure re-created from Terraform. RTO hours, RPO hours.
- Pilot light: core data replicated live to the DR region (Aurora Global Database, S3 Cross-Region Replication, DynamoDB global tables); compute scaled to zero and started during failover. RTO tens of minutes.
- Warm standby: a scaled-down but running copy of the full stack in the DR region; scale up and shift traffic. RTO minutes.
- Multi-site active-active: full capacity in two or more regions serving traffic simultaneously (Route 53 latency or geolocation routing, DynamoDB global tables). RTO near zero; requires handling multi-region writes and conflicts; the most expensive and complex.
Make DR real
Automate failover runbooks, keep infrastructure as code for both regions, protect backups in a separate account with immutability (Vault Lock, S3 Object Lock), and test failover regularly (game days). An untested DR plan is an assumption.
Follow-up questions interviewers ask
Try answering each one before you open it.
How does Route 53 failover work?
Create primary and secondary records with failover routing and attach a health check (an HTTP check on a deep health endpoint, or a CloudWatch alarm) to the primary. When the check fails, Route 53 answers with the secondary record. Keep TTLs low (for example 60 s), remember clients may cache DNS longer, and promote the DR database before or as part of switching traffic. Route 53 Application Recovery Controller adds readiness checks and safe manual routing controls.
What breaks first in active-active multi-region designs?
Data. Writes to the same record in two regions conflict (DynamoDB global tables use last-writer-wins), uniqueness constraints and counters cannot be enforced globally without coordination, and cross-region latency makes synchronous consistency expensive. Common solutions: partition users to a "home" region for writes, design idempotent and commutative operations, and accept eventual consistency where the business allows it.