Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 03 · System Design · Holding up under load · about 21 min to read

Watch: CAP: the cut phone line
▶ VideoPlay it as a journeyTutor comes with a plan

When the neighbour is slow: timeouts, retries, breakers

The Cut Phone Line
The Cut Phone Line · Open board

Two branches and the phone line between them. This lesson is about the line that is not cut, only slow, which is the harder case.

Before you start. You need The stall that turns people away (load shedding and admission control): work that a customer has already given up on is wasted work, refusing some orders early keeps the rest alive, and refused customers who retry at once make a retry storm. The cut phone line (CAP, done properly) gave you the timeout, the number of seconds you wait before you decide the other side is gone. Rate limiting: the token bucket gave you backoff, which means waiting longer after each failure, and jitter, which means adding a random amount to that wait.

Lesson 15 of 115 in System Design

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • 20 September 2015: DynamoDB at 2:19 in the morning
  • The timeout: a slow neighbour is worse than a dead one
  • The slow neighbour, run in a simulation
  • The retry budget: why retrying a slow neighbour is a trap
  • The circuit breaker: stop asking, on purpose
  • The bulkhead: one neighbour gets its own workers
  • Graceful degradation: a worse answer, not an error

Terms it explains: timeout, metastable failure, retry budget, circuit breaker, bulkhead, Graceful degradation, Common mistakes, deadline, availability, CAP, consistency (linearizable), eventual consistency, PACELC, partition, tunable consistency.

Lab

The line between the branches is cut. What does the far clerk say to the customer in front of them?

Pick Answer anyway, press Play next moment through all fourteen, and watch The bill so far count conflicting entries.

Open The cut phone line

Two cities changed the same order a moment apart. Which change survives, and what did it cost to be sure?

Pick Answer now, latest stamp wins, drag The west kitchen's clock to right on time, and watch Wrong change kept.

Open Two kitchens, two cities

Related papers

Review System Design