Distributed systems live on many machines with many clocks, and those clocks are never perfectly in sync. That gap creates two hard problems that pull in opposite directions.
Lamport clocks (1978) guarantee causal consistency: if event caused event , then . But a Lamport timestamp is just a counter — it drifts arbitrarily far from wall-clock time, so you cannot use it to answer questions like "give me everything that happened in the last five minutes."
Physical clocks (NTP, GPS, TrueTime) stay close to real time. But clock skew means two independent nodes can easily assign the same or even reversed timestamps to causally related events.
Hybrid Logical Clocks (HLC), introduced by Kulkarni, Demirbas, Madeppa, Avva and Bharadwaj in 2014, pack both worlds into a single compact timestamp: a physical component that tracks the maximum physical time seen so far, and a logical counter that breaks ties and advances only when the physical component cannot. The result is always within a bounded skew of true time — yet it respects causality just as faithfully as a Lamport clock.
The key invariant: for any two events and where (e happened before f), — and where is physical time.
Comments
Loading comments...