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
- Open the interactive lesson, with a mini quiz.
- Take the Distributed Systems & Cloud quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- 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?
Where do people use Clock Synchronization?
What is the most common mistake with Clock Synchronization?
What should I learn before this topic?
How can I practice it?
Is Clock Synchronization hard to learn?
How long does it take to learn Clock Synchronization?
Which topics are related to Clock Synchronization?
What should I study after Clock Synchronization?
Related topics
- Consistency Models (Distributed Systems & Cloud)
- Logical Clocks (Distributed Systems & Cloud)
- Replication Strategies (Distributed Systems & Cloud)
- Consensus Problem (Distributed Systems & Cloud)
- Clock Signal (Computer Architecture & Logic)