Clocks and ordering
Two servers save the same profile a second apart, and the database keeps the one with the later timestamp. But one server's clock runs three seconds fast, so the older edit wins and the newer one silently disappears. In a distributed system, you can't trust the time.
In this lesson you'll learn to
- Explain why physical clocks on different machines disagree, and the difference between wall-clock and monotonic time.
- Recognise when ordering events by timestamp loses data, as in last-write-wins.
- Use the happened-before relation, Lamport clocks and vector clocks to order events.
- Describe how bounded clock uncertainty, as in Spanner's TrueTime, makes timestamps safe to use.
Create a free account to open this lesson
It's free. You'll get every free lesson, quizzes that save your progress, daily flashcards and streaks.