TrueTime

TrueTime is the time API introduced in Google’s Spanner paper. Unlike an ordinary clock call that returns a single instant, TrueTime returns an interval [earliest, latest] and guarantees that the true current time lies somewhere inside that interval. The width of the interval represents the system’s honest uncertainty about what time it is.

That uncertainty is kept small because TrueTime is backed by two independent hardware time sources in each data center: GPS receivers and atomic clocks. The two reference types fail in different ways, so combining them keeps the reported uncertainty tight, typically only a few milliseconds.

The practical payoff is that Spanner can assign commit timestamps that are meaningful across the whole globe. Before committing a transaction, Spanner waits until it is certain the chosen timestamp has passed (a step the paper calls commit-wait), so that any later transaction is guaranteed a strictly greater timestamp. This is how Spanner achieves external consistency without exchanging clock messages on every operation.

TrueTime reframes a classic distributed-systems problem: instead of pretending clocks are perfectly synchronized, it makes the clock’s imprecision explicit and bounded, then designs the protocol to wait out that bound.