Bugpit

Lessons › From one user to millions

Survive a crash

Launch day: 10,500 requests per second. Machines die all the time. Any single one may crash, and once failover ends, users must not notice.

Play this level

Free with an account. It runs in your browser: build the design, press Run, and watch what breaks.

The lesson

Hardware fails. At scale it is not "if" but "when". Reliable systems assume any one machine can die and keep going (§10.2).

Redundancy means at least 2 of everything, so another copy takes over. The database gets a standby that is promoted if the primary dies. That typically takes 1–2 minutes, and writes fail until it's done.

A cache needs a spare too. If it dies, every read lands on the database at once. Losing 1 of 2 cache machines still loses half the keys, so make sure the database can carry the misses.

Capacity headroom (N+1) matters too: if 6 servers are just enough, losing 1 overloads the other 5. Keep one spare.

Try it: click any box and press "Crash one machine" to watch what happens, then repair it.

What you have to achieve

10,500 requests a second at the busiest hour, 10% of them writes.

What you learn

You designed for failure: no single point of failure and spare capacity. This is how real services stay up while machines die every day.

Check yourself

6 servers are just enough for your traffic. How many should you run?

Show the answer

7. N+1: keep one spare, so losing a machine doesn't overload the other five.

The primary database dies. What happens while the standby takes over?

Show the answer

Writes fail for a minute or two. Promoting a standby typically takes 1–2 minutes. Reads from replicas and caches can carry on.

Try it yourself

More in From one user to millions

← Move files off your servers Say no to a flood →