Practise failure before it happens
Failover, restores and runbooks are untested until the real incident.
Say it like this
A failover I have never run is a theory, so I kill instances and zones on purpose in a controlled window, restore backups on a schedule, and keep runbooks that someone other than the author has followed under a timer.
Basic solution
Inject failures in a controlled way, run game days, and drill region failover and backup restores on a schedule.
Hypothesis, injection, measured gap, fix, automate
Each experiment states the steady state and a hypothesis, injects one failure inside a blast-radius limit, measures the gap against the hypothesis, and turns the fix into a scheduled rerun.
How it works
- Define a steady state in metrics before touching anything: the SLIs that should not move during the experiment, such as redirect success rate and p99 latency, and the values they hold right now.
- Form a hypothesis in one sentence: "if one cache node dies, the hit rate dips for under 60 seconds and the database absorbs the misses without p99 breaching the SLO". The hypothesis is what the experiment will confirm or refute.
- Limit the blast radius, meaning how much of the system the failure can touch: one instance, one zone, or one percent of traffic. Run in a window with the on-call present, and have a kill switch that stops the injected failure within seconds.
- Inject the failure: terminate the instance, drop network traffic to the zone, add latency to a dependency, fill a disk, or let a certificate expire.
- Observe and record: did the steady state hold, did the expected alerts fire, did the runbook work when followed, and how long did recovery take. Write down the gap between the hypothesis and what actually happened.
- Fix what broke, then automate the experiment so it reruns on a schedule and a regression is caught by the rerun rather than by the next real incident.
- Disaster recovery drills are the large-scale version. Fail the primary region over to the secondary, restore last night's backup into a clean environment, and measure recovery time objective (RTO, how long until service is back) and recovery point objective (RPO, how much data was lost) against the targets.
Why it is a practice, not a tool
- The value is in the hypothesis and the measured gap. Running a chaos tool without a steady-state definition is just an outage you scheduled.
Worked example
Distributed cache cluster, quarterly game day
- Targets: RTO for a region failover of 15 minutes, RPO of 5 minutes for the backing store; cache node loss must not push database reads above 10K per second.
- Experiment 1, single cache node: terminate 1 of 60 nodes at 10 a.m. Expected: 1.7% of keys miss, the client ring updates in under 5 seconds, database reads rise from 2K to 2.5K per second for about a minute. Observed: ring update took 40 seconds because the registry TTL was 30 seconds, and database reads hit 6K per second. Fix: TTL to 5 seconds, clients drop a node on 3 consecutive failures. Rerun: 4-second ring update.
- Experiment 2, one zone (20 nodes): database reads would rise to about 12K per second for the TTL window; replicas in the other zones take the keys. Observed after the fix: reads peaked at 9K per second for 6 seconds, within the 10K limit.
- Experiment 3, region failover: DNS health check fails the primary, the secondary region's replica promotes, clients reconnect. Measured RTO 11 minutes, of which 6 were a human confirming the failover; RPO measured at 40 seconds of replication lag. Action: automate the confirmation for the one unambiguous case (primary region unreachable from three external vantage points).
- Restore drill: restore last night's 3 TB backup into a scratch cluster and run the integrity queries. Took 2 hours 10 minutes, against a 2-hour target; the fix was parallel restore across 4 workers, now 50 minutes.
- Cost of the game day: 6 engineers for 4 hours and about 50K cache misses hitting the database. Cost of discovering the 40-second ring TTL in a real zone outage at peak: a 10K read per second overload of the database.
Variants and when each wins
Manual game days
- A team runs scripted failure scenarios together for an afternoon. It wins on learning per hour; it does not scale and only happens when someone schedules it.
Automated continuous chaos (Chaos Monkey, Litmus, Gremlin)
- Random instance kills run in production during business hours, always on. It wins at keeping services honest about instance loss, once the manual runs have already found the big gaps.
Fault injection in dependencies
- Latency or errors are added at the client library or mesh for a percentage of calls to one dependency. It wins for testing timeouts, retries and circuit breakers without killing anything.
DR drills (region failover, backup restore)
- Scheduled, timed failovers and restores measured against RTO and RPO. It wins because it is the only way to know those numbers are real.
Recommendation: start with quarterly game days on the top three failure modes, add automated instance kills once they pass, and run a full region failover and a backup restore at least twice a year.
Failure modes
Experiment with no steady state
- The experiment runs and nobody can say whether it passed. It happens because no SLIs were defined before the failure was injected. Write the hypothesis and the metrics first, and make the abort criteria part of the plan.
Blast radius larger than planned
- A one-node kill turns into a cluster-wide incident. It happens because of hidden coupling, the very thing the experiment was meant to find, combined with no kill switch. Start in staging, then one instance in production, with an immediate stop and the on-call in the room.
Failover that nobody has run
- The DR plan assumes a 15-minute failover and it takes 4 hours. It happens because a DNS record turned out to be manual and a credential had expired, neither of which the plan mentioned. Run it, time it, fix the steps, run it again.
Backups that do not restore
- The restore fails on a corrupt snapshot or takes a day. It happens because restoring was never tested, only backing up. Automate a restore into a scratch environment with integrity checks, on a schedule.
Runbooks only the author can follow
- At 3 a.m. the on-call cannot execute the runbook. It happens because the steps assume knowledge the author had and never wrote down. Have someone else follow it in a drill under a timer; every ambiguity they hit becomes an edit or an automation.
Interviewer follow-ups
Answer out loud before you open each one.
How do you run chaos experiments safely in production?
Define the steady-state metrics and abort criteria first, limit the blast radius to one instance or one percent, run in a window with the on-call present, and keep a kill switch that stops the injection in seconds. Only automate an experiment after it has passed manually.
What is the difference between RTO and RPO, and how do you measure them?
RTO is how long until service is restored; RPO is how much data you may lose, measured as the replication or backup lag at the moment of failure. Both are only known by drilling: fail over a region and time it, restore a backup and compare the last record to the source.
Which failure would you inject first in the URL shortener?
Loss of the Redis cache, because the hypothesis is testable and the consequence is the biggest: the database must absorb 100% of redirect reads for the time it takes to fail over. If that holds, zone loss and a replica failover come next.
How does this connect to health checks and failover automation?
Chaos experiments are how you verify that health checks remove the right instances in the right time and that automated failover actually promotes a replica. Every gap found becomes a shorter TTL, a better probe or a step moved from the runbook into automation.
Connections
The same parts on other clouds
The diagrams above name AWS services as one concrete example. Every part has a close equivalent elsewhere. In an interview, name the role first, such as “a managed Redis cache”, then the product you would pick.
| AWS | Used here as | Google Cloud | Microsoft Azure | Open source and others |
|---|---|---|---|---|
| Amazon ElastiCache | Cache cluster | Memorystore | Azure Managed Redis | Redis, Valkey, Memcached |