Resilience
Resilience is the ability of a system to keep delivering an acceptable service when parts of it fail, and to recover fully afterwards.
At cloud scale, failure isn’t an exception; it’s a normal operating condition. Disks fail, instances get retired, networks partition, dependencies slow down and, occasionally, a whole data centre has a bad day. Your provider runs very reliable infrastructure, but under the shared responsibility model it’s your job to design workloads that keep working when part of it breaks.
Everything fails, all the time. Design for it rather than hoping it won’t happen.
The vocabulary
- Availability: the proportion of time a service is usable, often expressed in “nines”.
- RTO (Recovery Time Objective): how long you can be down before it really hurts.
- RPO (Recovery Point Objective): how much data you can afford to lose, measured as time.
- Availability zone: one or more physically separate data centres within a region, with independent power and networking.
- Region: a geographic area containing several availability zones.
- Blast radius: how much of the system (and how many customers) a single failure can affect.
The “nines” are worth doing the maths on:
| Availability | Downtime per year | Downtime per month |
|---|---|---|
| 99% | about 3.7 days | about 7.3 hours |
| 99.9% | about 8.8 hours | about 44 minutes |
| 99.99% | about 53 minutes | about 4.4 minutes |
| 99.999% | about 5.3 minutes | about 26 seconds |
Two things follow. First, every extra nine costs significantly more in architecture, money and operational discipline, so pick the target the business actually needs, not the one that sounds impressive. Second, dependencies multiply: a service that calls two others, each at 99.9%, can’t be better than about 99.8% unless it can cope without them.
Disaster recovery strategies
From cheapest and slowest to recover, to most expensive and fastest:
| Strategy | What it means | Typical RTO / RPO |
|---|---|---|
| Backup and restore | Back up data (ideally to another region and account) and rebuild everything from Infrastructure as Code when needed | Hours / hours |
| Pilot light | Data is replicated continuously and core infrastructure is pre-provisioned but idle in the recovery region | Tens of minutes / minutes |
| Warm standby | A scaled-down but fully working copy runs in the recovery region, ready to scale up | Minutes / seconds |
| Multi-site active/active | Full capacity runs in more than one region at once, serving traffic | Near zero / near zero |
Most workloads are well served by running across multiple availability zones in one region, plus backup and restore or pilot light to a second region. Active/active multi-region is genuinely hard, especially for data, so make it a deliberate decision driven by real requirements.
Design for failure
- Spread across availability zones by default, and keep compute stateless so any instance can be replaced.
- Use health checks and self-healing: load balancers, auto-scaling groups and orchestrators should replace failed components without a human.
- Set timeouts everywhere, then add retries with backoff and a circuit breaker. A slow dependency is often more dangerous than a dead one.
- Decouple with queues so spikes and failures don’t cascade (see Queue-Based Load Levelling).
- Limit the blast radius with separate accounts, bulkheads and, at large scale, cells.
- Degrade gracefully: decide in advance what the system does when a non-critical dependency is unavailable. Showing a cached result is better than showing an error page.
- Make operations idempotent so that retries are safe.
Prove it
A backup you’ve never restored isn’t a backup. It’s a hope.
Resilience claims are just guesses until they’ve been tested:
- restore backups regularly, into a clean account, and time it against your RTO
- run game days where the team practises recovering from a realistic failure
- use chaos engineering to inject failures (instance loss, latency, dependency errors) in a controlled way, starting in non-production
- write post-incident reviews that are blameless and focus on the system, and feed what you learn back into the architecture
As with everything else, use the architectural profile to decide how much of this you need. An internal reporting tool and a payments platform deserve very different levels of investment.