Skip to content
uencoder

Vector Clock

Vector clocks use an N-dimensional vector to track causality, determining whether events are concurrent or causally ordered; used for distributed version tracking.

Purpose

To determine event causality in distributed systems without a central clock, enabling causal consistency.

Mechanism

Each node maintains a vector VC[i]. On a local event, VC[self]++. Messages carry the sender VC; the receiver takes the per-dimension max. If VC[a] < VC[b], a causally precedes b; if incomparable, they are concurrent.

Use cases

  • Causal consistency
  • Version conflict detection
  • Distributed event ordering

Related tools

References