HomeDistributed & Parallel ComputingGoogle Spanner's TrueTime API: Turning Clock Uncertainty into a Global Guarantee

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

Explore how Google Spanner's TrueTime API exposes clock uncertainty as an explicit time interval, backed by GPS and atomic clocks, and how the commit-wait protocol turns that honesty about imprecision into provably correct global transaction ordering.

Distributed & Parallel Computing3DModerate60 FPS
spanner-truetime-lab ↗ Open standalone

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.

⚙ Under the hood

Explore how Google Spanner's TrueTime API exposes clock uncertainty as an explicit time interval, backed by GPS and atomic clocks, and how the commit-wait protocol turns that honesty about imprecision into provably correct global transaction ordering.

distributed systemsgoogle spannertruetimeclock synchronizationconsistencyatomic clockscommit protocolsdatabase internals

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)