Unit content
Vector clocks and concurrent updates
A Lamport clock preserves causal order in one direction, but its scalar timestamp cannot tell whether two events are causally related or merely concurrent.
A vector clock keeps one logical counter per participant. Each process increments its own component and merges received vectors componentwise using the maximum.
For event vectors $V(a)$ and $V(b)$,
$$a \rightarrow b$$
when every component of $V(a)$ is at most the corresponding component of $V(b)$ and at least one is smaller.
If neither vector is componentwise less than the other, the events are concurrent.
This lets a replicated system distinguish “one update descends from the other” from “both were produced independently.”
Vector clocks therefore carry richer causal information than scalar logical clocks, at the cost of metadata that grows with the set of participants being tracked.