Tinker Replication & consistency

by Samy (Kondasamy Jayaraman) · drawn with Colorfigures by April Zhu

10:20. R 2, W 2, last writer wins: 8 hinges sold, 1 lost from the count.North 1/0, East 1/0, West 2/0 · 1 sale

Chapter 5 of 7

Who wins

Quorums fixed the stale reads. But the two buyers of the last hinge are back, and the quorum still prints two receipts.

This chapter: When two writes clash, which one wins, and what is lost?

About this chapter

You will learn

  • Last writer wins keeps one write and drops the other
  • A lost update: a sale the count forgets
  • Reservations at one primary sell one at a time

Words you’ll meet

Last writer wins
A conflict rule: keep the version with the newest timestamp and drop the rest.
Lost update
A change that vanished because another write, based on older data, replaced it.
Primary
The one replica that decides every order, so sales happen one at a time.

Step 1 of 4

Quorums ended the stale reads: R and W are 2. The last hinge is down to one again.

Predict the receipts.

Quorums are on. At 10:22 Jo and Kim still buy the last hinge in the same minute. How many receipts?