案例库 · 工程与运营 · 技术决策 · 2012
这条还没译成中文,下面是英文原文。
Google's Spanner used atomic clocks and GPS to make a global database consistent.
Spanner added GPS receivers and atomic clocks so timestamps have a bounded uncertainty, giving globally-distributed transactions a real ordering.
那一手
A globally-distributed database wants transactions that look like they happened in one order, but servers in different datacenters do not share a clock and cannot agree on which write came first.
Spanner solves this with TrueTime: each datacenter reads from GPS receivers and atomic clocks, and reports a time interval instead of a single instant, so the uncertainty is explicit. A transaction waits until its commit time is safely after the latest possible time of any overlapping transaction, then commits with that timestamp to all replicas.
The result is the first system to offer externally-consistent distributed transactions at global scale, letting Spanner provide non-blocking reads in the past, lock-free read-only transactions and atomic schema changes across all replicas.
为什么管用
- GPS and atomic clocks bound the uncertainty, so time can be trusted
- Waiting out the uncertainty turns a guess into a provable ordering
- One global timestamp gives all replicas the same commit point
- It makes cross-region reads and schema changes safe to run in parallel
可以搬走什么
When a distributed system needs a total order, clever messaging isn't enough; make the shared clock trustworthy so ordering falls out of a time everyone agrees on.
后来呢
Spanner became the backbone behind Google's cross-region transactional services and was later offered publicly as Cloud Spanner. Its TrueTime approach became a case study in using real-world clocks to solve distributed consistency.
资料来源
发现哪里写错了?告诉我们。