Every time you transfer money, book a flight, or post something online, a database somewhere must decide: did this happen before or after that? On a single machine, the CPU clock settles the question in nanoseconds. Across thousands of servers spanning continents, the question becomes surprisingly hard â clocks drift, networks lag, and no global "now" exists.
For decades, engineers accepted a tradeoff: either sacrifice consistency (accept that different servers might disagree on the order of events) or sacrifice availability (force every write to wait for a slow network round-trip). Distributed systems literature called this the CAP theorem â pick any two of Consistency, Availability, and Partition tolerance.
In 2012, Google published a paper describing Spanner, a production database that had been running for years inside Google â serving Gmail, Google Ads, and other critical services â while providing something previously considered impractical: external consistency (also called linearizability) at planetary scale. The secret was TrueTime, a system that uses GPS receivers and atomic clocks at every data center to bound the uncertainty in wall-clock time to a tight interval, typically under 7 milliseconds.
Spanner does not cheat physics. Light still takes ~67 ms to cross the Atlantic. Instead, Spanner uses the known uncertainty in clocks to make transactions wait long enough that causality is never violated â a technique called commit-wait. The result: a globally replicated, strongly consistent, ACID-compliant database that proved the CAP tradeoff is not as rigid as once thought, as long as you are willing to pay in latency.
Comments
Loading comments...