Logical time is a system-defined ordering measure for events, not a measure of elapsed physical time. It helps reason about what happened before what in a distributed system, especially when message delays make physical timing inconclusive. section 2.0 section 2.2.4
The happened-before relationship provides the mental model: events on one component follow one another; sending a message happens before receiving it; and these relationships are transitive. Events without a happened-before relationship are concurrent. Logical clocks assign timestamps that preserve causally related order, but they do not turn concurrent events into physically ordered events. section 2.2.1 section 2.2.4
Common logical-time representations include:
- Lamport clocks: per-component counters incremented on steps; receivers update their counters using the maximum of local and received time, plus one. section 2.2.4
- Kafka offsets: positions order messages within one partition, but offsets cannot be compared across partitions. section 2.2.4
- etcd sequence numbers: per-key increments support operations such as compare-and-swap. section 2.2.4
Figure 2.18 Lamport clocks
Trace how Lamport-clock values advance across components and messages. section 2.2.4
