Skip to content

Logical clocks

Category: Distributed systems · Status: stub

One line: Counters that order events by cause instead of by wall-clock time: a Lamport clock gives every event a consistent order, a vector clock can also tell that two events were concurrent.

Also called: Lamport clock, vector clock, timestamp ordering.

How it connects

flowchart LR
  n_clock_skew["Clock skew and drift"]
  n_logical_clocks["Logical clocks"]
  n_clock_skew ---|or| n_logical_clocks
  classDef center stroke-width:3px
  class n_logical_clocks center
  classDef outside stroke-dasharray: 4 3
  class n_clock_skew outside

In each language

Elsewhere CockroachDB's transaction layer ↗ uses hybrid-logical clocks: a physical component close to local wall time plus a logical component

Where to read more