PrepCity

Vector clocks and conflicting writes

Open the lab

By the last page, this is the design you will have built.

Lesson · 13 pages · about 10 min

Vector clocks and conflicting writes

When two replicas accept writes during a split, last write wins silently drops one, and clock skew can make it drop the newer one. Vector clocks detect concurrent writes so they can be merged; Lamport clocks, hybrid logical clocks and CRDTs fill in the rest.

Words you’ll learn

  • Replica
  • Last write wins
  • Server
  • NTP
  • Millisecond
  • Event
  • Lamport clock
  • Vector clock
  • Sibling
  • Client

Page by page