High Availability and Fault Tolerance
Design multi-AZ systems without single points of failure, with health checks, timeouts, retries and graceful degradation.
Advanced · about 4 hours · difficulty 3/5
Learn first: The AWS Well-Architected Framework, Relational Databases with RDS and Aurora
Everything fails eventually: instances, disks, AZs, even whole services. Highly available systems keep working anyway.
Remove single points of failure
- Run at least two of everything across two or three AZs: instances in an ASG, ECS tasks, NAT Gateways for critical paths.
- Use Multi-AZ RDS or Aurora, and DynamoDB which is multi-AZ by default.
- Keep app servers stateless: sessions in ElastiCache or DynamoDB, files in S3.
- Prefer managed regional services (S3, SQS, Lambda) that are already spread across AZs.
Availability math
Availability is often expressed in nines: 99.9 percent allows about 8.8 hours of downtime a year; 99.99 percent about 53 minutes. Components in series multiply: two 99.9 percent dependencies give roughly 99.8 percent. Redundant components in parallel improve it.
Resilience patterns
- Health checks at the load balancer and Route 53.
- Timeouts on every network call, and retries with exponential backoff and jitter.
- Circuit breakers to stop hammering a failing dependency.
- Graceful degradation: show cached course listings if recommendations are down.
- Static stability: keep working even if the control plane (for example, the ability to launch new instances) is impaired.
- Chaos engineering with AWS Fault Injection Service to test all of the above.
Multi-region
Only needed for strict uptime or regulatory goals; it adds data replication, DNS failover and much more cost and complexity.
Pitfalls
- Two instances in the same AZ called "high availability".
- Retries without backoff, turning a small blip into a self-inflicted outage.
You are ready to move on when you can kill an instance or AZ subnet in your lab and show that users see no errors.
Key concepts
- Multi-AZ design
- Stateless application tiers
- Availability nines and SLAs
- Timeouts, retries, backoff and jitter
- Circuit breakers
- Graceful degradation
- Static stability
- AWS Fault Injection Service
Mini project
Using your Terraform or CDK code, deploy two free-tier instances in an ASG across two AZs behind an ALB, run a curl loop against it, then terminate one instance and later block one subnet with a NACL. Record any errors users would see. Keep the session short and destroy everything with one command at the end.
Check yourself
Your app depends on three services, each with 99.9 percent availability, called in series. What is the rough combined availability?