
Distributed Systems - Lamport Clock vs Hybrid Logical Clocks
Distributed Systems - Lamport Clock vs Hybrid Logical Clocks Why This Matters In a distributed system — especially one spanning multiple regions and datacenters — there's no single global clock. A node in Virginia and a node in Frankfurt each have their own clock, and they drift by milliseconds or more. Yet we need two guarantees: Causal consistency — if event A caused event B, every node in every datacenter must see A before B. A user in Tokyo shouldn't see a reply before the original message, just because their nearest replica processed the reply first. Total ordering — even for unrelated events happening simultaneously in different regions, we need a deterministic way to put them in a single, agreed-upon order. Every node across every datacenter must agree, and they need to do it without a central coordinator — fully decentralized. The tricky part? Neither Lamport clocks nor HLCs can actually detect concurrent events (Vector Clocks do that). But they don't need to — they solve a dif
Continue reading on Dev.to
Opens in a new tab



