Real-World Case Studies: Time, Clocks and Ordering

✅ Source-checked. Each deep dive names its source, and we kept only what that source says. Found an error, or something the source doesn't support? Report it on the tracking issue.

Three answers to "what happened first?": Lamport's logical clocks, Google's TrueTime with bounded uncertainty, and Amazon Dynamo's vector clocks.


🕰️ Deep Dive 1: Lamport Clocks, Ordering Without Real Time

Source: Leslie Lamport, "Time, Clocks, and the Ordering of Events in a Distributed System" (Communications of the ACM, 1978). Everything in this section comes from the paper.


🏢 Deep Dive 2: Google TrueTime, Real Time with Known Error

Source: Spanner: Google's Globally-Distributed Database (Corbett et al., OSDI 2012). Everything in this section comes from the paper.


🛒 Deep Dive 3: Amazon Dynamo, Vector Clocks and the Shopping Cart

Source: Dynamo: Amazon's Highly Available Key-value Store (DeCandia et al., SOSP 2007). Everything in this section comes from the paper.


ℹ️ An earlier version of this page claimed NTP drifts "100ms to 250ms" across continents and that before TrueTime "no distributed database" could offer global serializable transactions. We couldn't source either claim, so we removed them.

🎯 System Design Interview Takeaways

  1. Physical clocks can't order events reliably. Use logical clocks for causality, or bound the error explicitly as TrueTime does.
  2. Last-write-wins silently drops writes. If two concurrent updates both matter, keep both (vector clocks) and merge them.
  3. Merging has costs too. Dynamo's cart never loses an add, but a deleted item can come back. Say which failure your design accepts.