Skip to content

Clocks: physical, Lamport, vector and hybrid

Why wall clocks cannot order events across machines, and how Lamport, vector and hybrid logical clocks, and TrueTime's uncertainty intervals, fix it.

30 min8 steps

By the end you can
  • Bound the offset between two clocks from drift rate and sync interval, and explain why wall-clock order is unsafe
  • Apply the Lamport clock rules and state what a Lamport timestamp does and does not tell you
  • Use vector clocks to tell a happens-before relation from concurrency
  • Choose between physical, Lamport, vector, hybrid logical and TrueTime-style clocks for a requirement

Every clock is wrong, differently

  • 1 ppm

    1 us / s

    about 86 ms per day

  • Two clocks, T seconds

    2 x ppm x T us

    before sync error

  • NTP step

    can go backwards

    use a monotonic clock for durations

Loading question…

Answer this step to continue.