System Design Lab / Workbench / Incidents

Incidents you can run

Outage patterns that happen again and again in real systems. Each one opens in the Workbench as a design that breaks the same way. Run it, watch where it hurts, apply the fix with one tap and run again. The numbers come from the Workbench's simulator, scaled down to run in your browser.

Missing timeout (no bulkhead)

The slow payment provider

Checkout calls an outside payment API. It gets 40x slower, and soon nobody can even browse the shop.

What happened

  1. 0:20 The payment provider starts answering in about 2 s instead of 50 ms.
  2. 0:22 Checkout requests pile up in the app, each holding an app slot while it waits.
  3. 0:25 All app slots are taken by waiting checkouts: browsing, which never calls the provider, queues and fails too.
  4. 0:35 The provider recovers; the queue drains and the shop comes back.

The fix

Lesson: A slow dependency is worse than a dead one. Give every outside call a short timeout (and a circuit breaker) so one bad partner cannot take all your threads.

Run this incident in the Workbench →

Retries amplify an overload

The retry storm

The database becomes 12x slower for 20 s, so it can serve less than the 200 req/s offered. Calls time out after 300 ms and the app retries each failure 3 times at once: the struggling database gets about 30% more work, and fewer requests finish than with no retries at all.

What happened

  1. 0:20 The database slows down 12x (a bad query plan, a busy disk).
  2. 0:21 Calls start timing out after 300 ms; the app retries each one 3 times at once.
  3. 0:22 The database now gets far more calls than users send, so it stays overloaded.
  4. 0:40 The slowdown ends; only then does the extra work stop.

The fix

Lesson: Retries help with rare blips and hurt during overload. Retry once with backoff, and keep a retry budget.

Run this incident in the Workbench →

Thundering herd, limiter set too high

The flash sale

A sale opens and traffic jumps 5x for 10 s. A rate limiter is in place, but its limit was left at 100,000 req/s from a load test.

What happened

  1. 0:20 The sale starts: 1,000 req/s instead of 200.
  2. 0:20 The limiter lets everything through; the app and database queues fill.
  3. 0:22 Everyone waits seconds, many requests fail, including people who were already shopping.
  4. 0:30 The rush ends; queues drain over the next seconds.

The fixes

Lesson: Protect the system at the front door. A rate limit (or waiting room) just below what the back end can serve keeps it working for the people you admit.

Run this incident in the Workbench →

Single point of failure

The database failover

The primary database restarts and is gone for 10 s. Every request needs it, so every request in that window fails.

What happened

  1. 0:20 The database stops answering (a crash and a failover to a standby).
  2. 0:20 Every request fails: the app has no other place to read from.
  3. 0:30 The standby takes over and requests succeed again.

The fix

Lesson: Reads that can be served from a cache keep working while the database is away. Find what must hit the database and what does not.

Run this incident in the Workbench →

Queue hides a slow consumer

The growing backlog

Emails are sent by workers from a queue. The mail service slows down 5x; users see nothing wrong, but emails arrive minutes late.

What happened

  1. 0:10 The workers become 5x slower (the mail provider throttles them).
  2. 0:10 Users still get instant answers: the app only puts a job on the queue.
  3. 0:15 The queue grows every second; each email waits longer than the one before.
  4. 0:40 The slowdown ends, but the backlog takes a long time to clear.

The fix

Lesson: Queues protect users from slow back-end work, but they also hide it. Watch queue length and job age, and add consumers when the queue keeps growing.

Run this incident in the Workbench →