HomeDistributed & Parallel ComputingHybrid Logical Clocks Lab

🕰️ Hybrid Logical Clocks Lab

Explore Hybrid Logical Clocks (HLC), a timestamping scheme that blends physical wall-clock time with a logical counter so distributed systems get timestamps close to real time while still preserving causal ordering.

Distributed & Parallel Computing3DModerate60 FPS
hybrid-logical-clocks-lab ↗ Open standalone

The simulation demonstrates how each node's Hybrid Logical Clock updates on local events and on receiving messages, showing the physical time component staying close to real wall-clock time while the logical counter increments only when needed to preserve causal ordering between events across nodes with independently drifting clocks.

🔬 What It Demonstrates

The simulation demonstrates how each node's Hybrid Logical Clock updates on local events and on receiving messages, showing the physical time component staying close to real wall-clock time while the logical counter increments only when needed to preserve causal ordering between events across nodes with independently drifting clocks.

🎮 How to Use

Add nodes with independently drifting physical clocks, trigger local events on any node to see its HLC advance, and send messages between nodes to watch the receiving node's HLC merge the maximum of its own prior timestamp, the incoming timestamp, and its current physical clock, with the logical counter incrementing exactly when physical time alone cannot resolve the order. Compare the resulting HLC pairs to confirm that causally related events always end up correctly ordered.

💡 Did You Know?

In most production traffic patterns, the logical counter portion of an HLC timestamp stays at zero or a very small number almost all the time, since it only needs to increment during bursts of causally related events that land within the same physical clock tick, which is why HLC timestamps look and behave almost exactly like ordinary timestamps in everyday use.

⚙ Under the hood

Explore Hybrid Logical Clocks (HLC), a timestamping scheme that blends physical wall-clock time with a logical counter so distributed systems get timestamps close to real time while still preserving causal ordering.

distributed-systemshlcclock-synchronizationcausalitytimestampsdatabasesconsistency

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)