Day 30: Conduct a Post-Mortem and Document System Architecture with Playbooks — and Learn from Our Failures
Day 30: Conduct a Post-Mortem and Document System Architecture with Playbooks
On Day 29, we finalized our clustered storage engine, complete with multi-node consensus and active replication. Today, we transition from the role of the builder to the role of the operator.
We are going to explore what happens when a healthy cluster is pushed over the cliff by its own recovery mechanisms. We will analyze a classic distributed systems failure mode—the recovery storm—and learn how to write the code that prevents it, how to document the failure in a professional post-mortem, and how to write runbooks that keep systems alive at 3 AM.
The Production Stakes: The Day US-East-1 Stood Still
On September 20, 2015, Amazon DynamoDB experienced a severe, multi-hour outage in the US-East-1 region. The root cause was not a hardware failure or a malicious attack. It was a recovery storm.
DynamoDB uses a Paxos-based metadata service to manage partition membership. Following a brief network hiccup, a large number of storage nodes lost their leases. When network connectivity returned, thousands of nodes simultaneously attempted to re-register and fetch their latest partition maps from the metadata service.
The metadata service was flooded. As it struggled to process the requests, response times spiked. Storage nodes timed out, assumed the registry was dead, and retried immediately. This feedback loop kept the metadata service at 100% CPU utilization, rendering it unable to do useful work. The system was locked in a state of mutual destruction. It could not recover because the recovery mechanism itself was the bottleneck.
Before today, our DurableKV cluster suffered from this exact vulnerability. If multiple nodes rebooted simultaneously, they would flood the coordinator with registration requests, causing a cascading failure. After today, our nodes will use token-bucket rate limiting and jittered exponential backoff to ensure the cluster can self-heal under load.
The Core Concept: Thundering Herds and Recovery Storms
When a distributed system experiences a partial failure, nodes must recover their state. However, if every recovering node immediately requests state from a central coordinator, the coordinator experiences a Thundering Herd problem.
If we do not design our recovery paths with the same care as our write paths, we create a system that works perfectly under normal load but can never recover from a cold start or a network partition.
The Math of Jitter
To break the synchronization of retrying nodes, we use Jitter—randomized delay. Without jitter, nodes retrying with standard exponential backoff will still retry in synchronized waves.
The formula for decorated jittered backoff is:
Keep going with the full lesson
The rest of this lesson — plus its implementation guide, runnable scripts and source code — is included with the course or an All Access plan. Create a free account to start the free lessons in every course.
Already a member? Sign in