Lamport Clocks, Vector Clocks, and Causality
Physical clocks drift and cannot establish a perfect global event order. Lamport clocks assign logical counters that preserve the happens-before relation: if A causally precedes B, A receives a smaller timestamp. The reverse does not hold; a smaller timestamp does not prove causality.
Vector clocks track version counters across participants and can identify concurrent versions, but metadata grows and membership changes complicate the model. Hybrid logical clocks combine physical-time information with logical counters to provide useful time locality while preserving protocol-specific ordering properties.
Choose the smallest ordering scope that meets the requirement. A chat system may need order within each conversation; a global total order across unrelated entities is much more expensive. Timestamps, logical clocks, and consensus solve different problems.
- Wall-clock timestamps do not prove causality.
- Lamport clocks preserve causal order but cannot fully identify concurrency.
- Specify the scope of ordering before choosing coordination.