Bitpath

Lesson 2 · Unit 02

Quorums

No leader: overlap reads with writes

12 exercisesabout 3 min

What you practise

  • Leaderless reads and writes, N, W and R with W + R > N, what overlap guarantees, sloppy cases, read repair, conflicts and last-write-wins

Try a question from this lesson

Pick one

Three replicas, no leader. A write counts as done once 2 of the 3 confirm it. Later a read asks any 2 replicas. Why must at least one of them have that write?

The ideas

Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.

Concept

W + R > N

With N replicas, a write waits for W confirmations and a read asks R replicas.

If W + R > N, every read overlaps every successful write in at least one replica, so the read sees the newest value: it keeps the reply with the highest version.

Any node can take reads and writes. No leader, no failover.

N = 3    W = 2    R = 2

replica:          A    B    C
write confirmed  [x]  [x]   .
read asks         .   [x]  [x]
                       ^
                    overlap

Concept

Read repair

A quorum read often finds replicas that disagree: some were down or slow when a write happened.

The read returns the newest version and also writes it back to the stale replicas. This is read repair. A background process compares replicas too, so keys that are rarely read get fixed as well.

9 more exercises in the app

  • 3× type the answer
  • 3× multiple choice
  • 1× true or false
  • 1× fill the blanks
  • 1× match the pairs

Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.

One email when Bitpath is ready to try. Nothing else. Privacy