Suppose you transfer money in a bank that stores its data in Tokyo, Frankfurt and Virginia. You expect the database to act as if one machine saw every transaction, one after another, in the real order they happened. That sounds obvious. It is extremely hard, because computers in different cities do not share a clock.
Spanner, Google's global database, achieves it by doing something bold: it uses GPS receivers and atomic clocks to know the time very precisely, and, more importantly, it is honest about the remaining doubt. In the authors' words, it is the first system to distribute data at global scale and still support externally-consistent distributed transactions.
Spanner's TrueTime API says "the time is somewhere between A and B." To order transactions correctly, Spanner picks a timestamp and then waits out the uncertainty before telling anyone the transaction is done. A few milliseconds of waiting buys strong consistency worldwide.
What "externally consistent" means
The promise is simple. If transaction T1 finishes before transaction T2 starts, then every observer sees T1 first. Not just on one machine. Everywhere, with data replicated around the world. This is stronger than ordinary serializability, which allows any order as long as it is consistent.
Why is it hard? To order two transactions on different machines you need timestamps, and timestamps come from clocks. Clocks drift. If the clock in Virginia is a little ahead of the one in Frankfurt, a later transaction can get an earlier timestamp. Lamport clocks avoid physical time. Spanner chooses the opposite route: make physical time trustworthy.
TrueTime: a clock that tells you how wrong it might be
A normal clock call returns one number. TrueTime's TT.now() returns an interval [earliest, latest], and it guarantees that the true time lies inside it. There are also helper calls: TT.after(t) is true only when t has definitely passed, and TT.before(t) is true only when t has definitely not arrived.
