← 🛰️ Distributed Systems

🛰️ Google Spanner's TrueTime API: Turning Clock Uncertainty into a Global Guarantee

Commit Wait:
Ordering Guarantee:
Drag — rotate · Scroll — zoom

🛰️ Google Spanner's TrueTime API: Turning Clock Uncertainty into a Global Guarantee

The simulator visualizes how TrueTime's uncertainty interval shrinks and grows in response to simulated GPS and atomic clock signal quality, and shows how commit wait delays the visibility of a transaction's effects until the interval has provably elapsed, allowing you to see external consistency emerge across two or more simulated data centers in real time.

🔬 What It Demonstrates

The simulator visualizes how TrueTime's uncertainty interval shrinks and grows in response to simulated GPS and atomic clock signal quality, and shows how commit wait delays the visibility of a transaction's effects until the interval has provably elapsed, allowing you to see external consistency emerge across two or more simulated data centers in real time.

🎮 How to Use

Start by adjusting the simulated clock reference quality, degrading GPS signal or increasing atomic clock drift, to see how the width of the TrueTime interval reacts. Then trigger sample transactions on two different simulated data center nodes and watch the commit-wait countdown before each transaction's effects become visible. Try creating two transactions in quick succession and observe how their assigned commit timestamps and commit-wait delays interact to preserve correct real-time ordering, then intentionally widen the uncertainty interval to see how commit-wait latency grows in response.

💡 Did You Know?

In Google's published measurements, the TrueTime uncertainty interval, epsilon, typically averaged only a few milliseconds across their global fleet, and even during degraded conditions such as a burst of time-master outages, it rarely grew beyond roughly seven milliseconds, a remarkably tight bound for a system spanning data centers on multiple continents.