Hybrid Logical Clock
Hybrid Logical Clock (HLC) is a timestamping mechanism that combines physical and logical clocks to provide causally consistent ordering of events in distributed systems. It uses physical time from system clocks for coarse-grained ordering and logical counters for fine-grained ordering when physical clocks are not synchronized. HLC ensures monotonicity and causality without requiring perfectly synchronized clocks, making it more practical than pure logical clocks like Lamport timestamps.
Developers should learn HLC when building distributed systems that require event ordering, such as databases, message queues, or replication protocols, where physical clock synchronization is unreliable. It is particularly useful in scenarios like conflict resolution in eventually consistent databases, debugging distributed traces, or implementing causal consistency models, as it provides timestamps that are both causally meaningful and close to real-time.