AlgoMaster Logo

Logical Clocks

Low Priority12 min readUpdated July 4, 2026
AI Mock Interview

Practice this topic in a realistic system design interview

Physical clocks answer the question, "What time did this happen?"

Logical clocks answer a different question: "What could have caused this event?"

That difference is the whole reason logical clocks exist.

Many distributed-system bugs are not really about calendar time. They are about order.

For example:

  • Did this read happen after the write it should see?
  • Did this update know about the previous update?
  • Did this service receive a message after the sender actually sent it?

Physical timestamps cannot answer those questions reliably by themselves, because machine clocks drift and disagree. Logical clocks give systems a way to reason about cause and effect without trusting perfectly synchronized clocks.

This chapter explains happens-before, concurrent events, causal order versus total order, the clock condition, and the main logical clock designs: Lamport timestamps, vector clocks, and hybrid logical clocks.

1. The Core Idea

Premium Content

This content is for premium members only.