Time in Distributed Systems

Lesson 14 of 4015 min readPremium lesson preview
In this lesson1 sections

Time in Distributed Systems

This lesson separates physical time from causal order. You will trace Lamport and vector clocks, identify what each timestamp can prove, and examine how a distributed snapshot records a consistent state while messages are still moving.

Within one sequential process, program order gives a local event sequence. Concurrent threads on the same server already require more care; a wall clock alone does not establish which operation caused another.

Across multiple servers, each process observes only its own events and received messages. If two friends send chat messages independently, the system may need to choose a display order even though neither message caused the other.

Relying solely on the local clocks of machines is not a safe approach.

Network delays and inaccurate clocks can cause errors, such as messages appearing in the wrong order or even data being lost. Ensuring events are ordered correctly is one of the primary challenges in distributed System Design.

To solve this, we do not depend only on physical time. Instead, we use logical time, which tracks the order of events across the system rather than relying on wall-clock time.

Why is time challenging in distributed systems?

In a distributed system, there is no single source of truth for time.

The rest of this lesson is for Premium members

Premium opens every lesson in this course, along with all questions and solutions on PracHub.