LearnViz CompSci
Home / Learn / Distributed Systems & Cloud / Clock Synchronization

Intermediate Topic 19 of 51 Distributed Systems & Cloud

Clock Synchronization

Aligning clocks across machines.

How it works

Distributed machines have separate physical clocks that drift, so timestamps from different nodes may disagree. Protocols such as NTP and PTP synchronize clocks to reference time sources by measuring network delay and adjusting offsets, achieving milliseconds or better, while GPS and atomic clocks give higher accuracy. Google's Spanner uses TrueTime, which exposes uncertainty bounds and waits out the uncertainty to give external consistency. Algorithms such as Cristian's and Berkeley's illustrate the principles.

Where it is used

Log correlation, certificate validity, expiry of leases and tokens, scheduling, financial trading records and distributed transactions depend on synchronized time.

Common pitfall

Using wall-clock timestamps to order events across machines is unsafe: clocks can jump, drift backward and have leap seconds. Last-write-wins based on clocks can lose updates. Leases assume bounded clock drift. Use monotonic clocks for measuring durations, logical or hybrid clocks for ordering, and monitor clock skew.

Where it fits in the course

Clock Synchronization is topic 19 of 51 in Distributed Systems & Cloud, rated Intermediate. It follows Consistency Models. The next topic is Logical Clocks.

Practice and explore

How to study this topic

  1. Read the explanation above and restate the definition in your own words.
  2. Open the interactive lesson and answer its mini quiz.
  3. Read the common pitfall, then write a short example that avoids it.
  4. Check your understanding in the Distributed Systems & Cloud quiz, and revisit the topic if you miss a question.

Frequently asked questions

What is Clock Synchronization?
Aligning clocks across machines. It belongs to Distributed Systems & Cloud and is an intermediate-level topic.
Where do people use Clock Synchronization?
Log correlation, certificate validity, expiry of leases and tokens, scheduling, financial trading records and distributed transactions depend on synchronized time.
What is the most common mistake with Clock Synchronization?
Using wall-clock timestamps to order events across machines is unsafe: clocks can jump, drift backward and have leap seconds.
What should I learn before this topic?
Start with Consistency Models, the topic just before it in Distributed Systems & Cloud.
How can I practice it?
Answer the mini quiz in the interactive lesson, then take the Distributed Systems & Cloud quiz.
Is Clock Synchronization hard to learn?
It is an Intermediate topic. Be comfortable with the Beginner topics in this area first, then read the common pitfall carefully, since it is where most mistakes happen.
How long does it take to learn Clock Synchronization?
Most learners can read the explanation and finish the interactive lesson in under an hour. Fluency comes from applying the idea, so plan a few short practice sessions with the quiz.
Which topics are related to Clock Synchronization?
Consistency Models, Logical Clocks, Replication Strategies are closely connected. The full list is in the related topics section of this page.
What should I study after Clock Synchronization?
Continue with Logical Clocks, the next topic in Distributed Systems & Cloud.

Related topics