A Globally Distributed SQL Database
Google Spanner spreads data across data centers worldwide yet still offers strong transactions. The hard part is ordering transactions consistently when clocks on different machines disagree. Spanner solves this with TrueTime.
What TrueTime Provides
Ordinary clocks return a single timestamp that may be wrong. TrueTime instead returns an interval with an earliest and latest possible time, backed by GPS receivers and atomic clocks. The width of this interval is the uncertainty.
Commit Wait
When a transaction commits, Spanner picks a timestamp and then deliberately waits until the uncertainty interval has fully passed before releasing the result. This commit wait guarantees that any later transaction sees a strictly greater timestamp.
Why This Matters
The payoff is external consistency, the strongest practical guarantee. If transaction A finishes before transaction B starts in real time, then A is ordered before B everywhere. Smaller clock uncertainty means shorter waits and higher throughput, which is why the hardware investment pays off.
Key idea
TrueTime exposes bounded clock uncertainty, and by waiting out that interval at commit Spanner guarantees external consistency for transactions spread across the globe.