Capacity Planning, High Availability and Disaster Recovery
Design for failure with redundancy, load testing, capacity forecasts and recovery plans measured in RPO and RTO.
Advanced · about 5 hours · difficulty 4/5
Learn first: SLIs, SLOs and Error Budgets, Cloud Networking and Storage Design
Reliability is designed in, not added after an outage. This topic covers the planning side of SRE.
High availability patterns
- Remove single points of failure: at least two of everything across zones, with health-checked load balancing.
- Graceful degradation: serve cached or partial results when a dependency fails.
- Timeouts, retries with backoff and jitter, circuit breakers so one slow dependency does not cascade.
- Bulkheads and rate limits to isolate noisy tenants.
Capacity planning
- Know your headroom: how much traffic you can take before latency or errors climb.
- Load test with tools like k6, Locust or JMeter against realistic traffic shapes, and find the first bottleneck.
- Forecast from growth trends and planned launches; account for zone failure (N+1 capacity).
- Autoscaling helps but has limits: warm-up time, quotas, database connections.
Disaster recovery
- RPO (recovery point objective): how much data you can afford to lose.
- RTO (recovery time objective): how long you can be down.
- Strategies from cheapest to fastest: backup and restore, pilot light, warm standby, multi-site active-active.
- Keep backups in another region and account, and codify the rebuild in IaC.
- Test the plan: game days and restore drills. An untested DR plan is a hope, not a plan.
Good enough to move on: you can load test a service to find its limit, name its single points of failure, and write a DR plan with RPO, RTO and a strategy that matches them.
Key concepts
- Removing single points of failure
- Timeouts, retries and circuit breakers
- Graceful degradation
- Load testing with k6 or Locust
- Capacity forecasting and headroom
- RPO and RTO
- DR strategies: backup to active-active
- Game days and restore drills
Mini project
Load test your demo service with k6 to find its breaking point, document the bottleneck and fix it, then write a DR plan with RPO and RTO and rehearse restoring it in a second region from backups.
Check yourself
A business says it can lose at most 5 minutes of data and be down at most 1 hour. Which DR strategy fits, and what does it cost compared with backup and restore?
Free resources
- Addressing Cascading Failures (SRE Book) (Google SRE)
- Grafana k6 documentation (Grafana Labs)
- AWS disaster recovery whitepaper (AWS)