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 10 · From Scratch · Sharded KV store · with code: Go · about 16 min to read

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

KV: everything

The Cut Phone Line
The Cut Phone Line · Open board

Two copies that cannot reach each other, and the choice between answering and refusing. The last three builds chose to answer. This one pays the bill that choice runs up, then kills two machines and measures the whole store.

Before you start. KV: hinted handoff kept the store taking writes while machines were down: a healthy machine stood in for a dead one and kept the value as a hint, a note saying who it really belongs to, and handed it over when the owner came back. And a read that noticed a copy behind fixed it on the spot. Amazon, the case study tells how Amazon put these same pieces under its shopping cart. Two holes were left open: hints are only kept for a while, and a read only fixes keys somebody reads. This lesson closes both.

Lesson 75 of 117 in From Scratch

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

  • Early 1986: Xerox’s name servers, and 90,000 letters a night
  • Where the parcels ran out: the machine that stayed away too long
  • Two phone books, compared without reading them: a checksum
  • A fingerprint per slice, then per pair of slices: the Merkle tree
  • Kill two nodes and measure: the whole store
  • Why the outage itself showed no stale reads
  • Building the tree
  • The walk down
  • The 43, the 511, and when the tree stops helping
  • Where each number came from
  • Check every stage

Terms it explains: anti-entropy, hint window, checksum, Merkle tree, 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 From Scratch