Distributed Systems
Clocks: free-recall review
Retrieval beats re-reading. For each prompt, say or write a full answer from memory before you open the model answer — the effort of recall is what makes the material stick.
Reconstruct the unit’s core ideas — why wall-clock time can’t order distributed writes, the happens-before relation, Lamport vs vector clocks, and how TrueTime makes physical time trustworthy — without looking back at the lesson.
- 01Why are a timestamp from machine A and a timestamp from machine B not comparable as an ordering, even with NTP running?
- 02Walk through exactly how clock skew turns into silent data loss under last-write-wins.
- 03Define the happens-before relation and what a Lamport timestamp guarantees about it.
- 04When do you need vector clocks instead of Lamport timestamps, and what do they cost?
- 05What does Spanner's TrueTime expose, and how does commit-wait use it to deliver external consistency?
- 06A teammate says 'just run NTP and last-write-wins is safe.' Give the one-paragraph senior rebuttal.
If you could reconstruct each answer from memory, you hold the unit’s spine: wall-clock time drifts and steps backward, so it is not an ordering primitive and LWW turns skew into silent data loss; happens-before is the causal partial order; Lamport timestamps give a cheap total order consistent with causality but cannot detect concurrency; vector clocks recover concurrency detection at O(n) metadata; and TrueTime makes physical time trustworthy by quantifying uncertainty as a bounded interval and waiting it out. The senior instinct: never order distributed writes by the wall.