Index

Module 08 · From ScratchSharded KV store

Watch: Replication: the copy clerks →▶ Watch the video

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.

Continue reading with a plan

The first three lessons of every track are free. This lesson is included with a plan, which unlocks every lesson, board, video, lab and paper for one price.

View plans →Already a member? Sign in

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 paper

Review From Scratch →

Saved in this browser, and to your account when you sign in.