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 15 min to read

Watch: Replication: the copy clerks
▶ VideoPlay it as a journeyTutor comes with a plan

KV: quorum

The Copy Clerks
The Copy Clerks · Open board

One book copied by clerks who each run a moment behind. In that picture one book is the master and the clerks follow it. In this build there is no master: three copies, all equal, and a vote decides what counts as saved.

Before you start. KV: the ring built the ring: every key (the name a value is stored under) hashes to a spot on a clock face, and walking clockwise from it gives an ordered list of three different machines, its preference list, which is where the key’s copies live. The copy clerks (database replication) and Replication showed why copies disagree: a copy is updated over a network, a moment later than the original, so for a moment it holds the old value. This lesson decides how many copies you wait for when you write, and how many you ask when you read.

Lesson 73 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

  • 1979: David Gifford gives every copy a vote
  • Three copies and a slow wire: replicas, and a version on each
  • Wait for how many? W, R, and the quorum
  • When the groups miss: the stale read
  • The price: every vote you require is a machine that must be up
  • Put and Get
  • Where 66.67% and 33.33% come from
  • What R + W > N does not promise
  • What each setting costs

Terms it explains: replica, version, quorum, stale read.

Lab

You pay your tab at stall A and walk to stall B. What do they say you owe?

Stay on Copy later, press Play next moment fourteen times, then raise Moments the clerks run behind and watch the stale answers count.

Open The copy clerks

Related papers

Review From Scratch