Failure stories
The rules that break take a slogan and show the arithmetic that defeats it. Failure stories work the other way round. Each one starts with a design that a capable team would ship, then shows a short, specific sequence of events in which it does the wrong thing, with no bug in any single component.
They’re the failures that pass code review, pass unit tests and pass the dashboard, because each step on its own is correct.
How each story works
Section titled “How each story works”| Part | What it gives you |
|---|---|
| The challenge | The question to put to a reader or a class before they see the answer |
| The setup | The system and every assumption, small enough to hold in your head |
| What happened | The failure as a numbered timeline |
| Why it went wrong | The guarantee the team thought they had, and where it actually stopped |
| Two designs | The design that failed and a competing design, compared side by side |
| The check | An observable test that passes for one design and fails for the other, so the argument is settled by evidence |
| When the simpler design is enough | The conditions under which the first design is fine |
| For educators | A discussion question and an exercise that changes one condition, with a worked answer |
The stories are constructed: small, explicit scenarios, not reports of real incidents. Where published material describes the same mechanism, each page links to it.
The stories
Section titled “The stories”Requests, retries and side effects
Section titled “Requests, retries and side effects”| Story | The challenge |
|---|---|
| The reservation that succeeded twice | The server committed the booking, the customer saw a timeout, and the retry has a new request ID. What should the system do? |
| The idempotency key that hid a changed order | The client reused its key after the customer changed the quantity from 1 to 3. What did the customer get? |
| The cancellation that arrived before the booking | The cancellation found nothing to cancel. Then the booking arrived. Is the booking active? |
| The outbox that shipped two packages | The order and its event committed atomically. How did one order create two shipments? |
Events and replay
Section titled “Events and replay”| Story | The challenge |
|---|---|
| The replay that emailed every customer again | The team rebuilt one read model from history. Why did customers get confirmation emails for last year’s orders? |
| The compatible schema that changed the meaning | The schema registry accepted the change. Why do reservations now last eight hours instead of 30 seconds? |
| The dead-letter redrive that reopened a canceled order | An operator redrove one failed message. Why is a canceled order open again? |
| The replay that calculated a different invoice | Same events, same code. Why does the rebuilt invoice disagree with the one the customer paid? |
Time, ownership and inter-agency data
Section titled “Time, ownership and inter-agency data”| Story | The challenge |
|---|---|
| The newest timestamp came from the least authoritative source | Last-write-wins kept the newest record. Why is a verified address gone? |
| The address correction that rewrote history | A correction arrives in April, effective in March. What address should a reviewer of a March decision see? |
| The missing record that closed a valid case | The nightly file had no row for 4,000 active cases. Were they closed? |
| The records that could be merged but never separated | Two residents were wrongly merged and both agencies kept updating. Whose update is whose? |
Migration, backfills and cutovers
Section titled “Migration, backfills and cutovers”| Story | The challenge |
|---|---|
| The backfill that overwrote a live update | Live replication wrote revision 8. Why does the target now hold revision 7? |
| The rollback that lost successful orders | Rollback took 40 seconds and worked. Where are the 12 orders customers were told were placed? |
| The migration that passed reconciliation | Same row count, same total quantity. Is it safe to cut over? Includes a lab you can run. |
| The shadow test that missed the dangerous requests | Shadow traffic showed 100% agreement. Why did the new system fail in production? |
Concurrency and ownership
Section titled “Concurrency and ownership”| Story | The challenge |
|---|---|
| Two valid transactions left nobody on call | Each transaction checked that someone else was on call. Both committed. Who’s on call? |
| The worker that kept writing after its lease expired | Worker A’s lease expired and B took over. How did A’s write win? |
| The cache that went stale right after invalidation | The writer invalidated the cache after committing. Why does the cache serve the old value indefinitely? |
| The compensation that undid somebody else’s work | The failed saga compensated correctly. Why did another customer’s reservation disappear? |
Observability and recovery
Section titled “Observability and recovery”| Story | The challenge |
|---|---|
| The autoscaler that made the backlog worse | The queue grew, so the autoscaler added workers. Why did completions fall? |
| The healthy dashboard for a broken customer journey | API availability was 100% all afternoon. Why were no orders delivered? |
| The self-healing restart that prevented recovery | Kubernetes restarted the slow pod to heal it. Why did it never become ready? |
| The green canary that failed a small tenant | The canary’s success rate never dropped below 99.9%. Why did one customer lose every request? |
Use the checks in your own tests
Section titled “Use the checks in your own tests”Every story’s check is in the checks catalog as test templates in Java (JUnit 5) and Python (pytest), with SQL invariants you can run in production as monitors.
Using them in teaching
Section titled “Using them in teaching”Each story runs as a 30- to 45-minute session:
- Put the challenge to the group before showing anything else. Ask for an answer and a reason.
- Walk through the timeline one step at a time and ask where it first goes wrong. Groups usually disagree, which is the point.
- Compare the two designs, then ask what evidence would convince a sceptic that one is better.
- Set the exercise, which changes one condition. Worked answers are on each page.
The stories in Time, ownership and inter-agency data work especially well with mixed groups of architects, analysts and policy staff, because the right answer depends on a business rule that someone has to own, not only on code.
Related pages
Section titled “Related pages”- Rules that break, the six rule-based counterexamples
- Incidents by mechanism, published postmortems sorted by the mechanisms these stories teach
- Failure library, real incidents and what they teach
- Example Lending, a complete architecture that designs for many of these failures
Written and edited by Abhinav Taduka, enterprise software architect.
New pages are added regularly. Follow Abhinav on LinkedIn to see them first.