Ordering Without a Global Clock
Wall clocks across nodes drift, so they cannot reliably order events. A vector clock tracks causality instead. Each node keeps a counter for every node in the system. On a local event a node increments its own counter, and when it receives a message it takes the element wise maximum of the two vectors.
Reading the Vectors
Compare two vectors element by element.
- If every element of A is less than or equal to B and at least one is strictly less, then A happened before B.
- If neither dominates the other, the events are concurrent, meaning they have no causal order.
Why This Helps Replicas
When two replicas disagree on a value, vector clocks reveal whether one update causally followed the other or whether they happened independently.
- A causally later version simply supersedes the earlier one.
- Two concurrent versions are a genuine conflict that must be merged or surfaced to the application, never silently dropped.
This prevents a slow path update from being lost to a stale write that only looked newer by timestamp.
Key idea
Vector clocks track per node counters so replicas can tell causally ordered updates from concurrent conflicts, keeping real conflicts from being silently lost.