tailieunhanh - Spanner: Google’s Globally-Distributed Database

These features are enabled by the fact that Spanner as- signs globally-meaningful commit timestamps to trans- actions, even though transactions may be distributed. The timestamps reflect serialization order. In addition, the serialization order satisfies external consistency (or equivalently, linearizability [20]): if a transaction T1 commits before another transaction T2 starts, then T1’s commit timestamp is smaller than T2’s. Spanner is the first system to provide such guarantees at global scale. The key enabler of these properties is a new TrueTime API and its implementation. The API directly exposes clock uncertainty, and the guarantees on Spanner’s times- tamps depend on the bounds that the implementation pro- vides. If the uncertainty is large, Spanner slows. | Spanner Google s Globally-Distributed Database James C. Corbett Jeffrey Dean Michael Epstein Andrew Fikes Christopher Frost JJ Furman Sanjay Ghemawat Andrey Gubarev Christopher Heiser Peter Hochschild Wilson Hsieh Sebastian Kanthak Eugene Kogan Hongyi Li Alexander Lloyd Sergey Melnik David Mwaura David Nagle Sean Quinlan Rajesh Rao Lindsay Rolig Yasushi Saito Michal Szymaniak Christopher Taylor Ruth Wang Dale Woodford Google Inc. Abstract Spanner is Google s scalable multi-version globally-distributed and synchronously-replicated database. It is the first system to distribute data at global scale and support externally-consistent distributed transactions. This paper describes how Spanner is structured its feature set the rationale underlying various design decisions and a novel time API that exposes clock uncertainty. This API and its implementation are critical to supporting external consistency and a variety of powerful features nonblocking reads in the past lock-free read-only transactions and atomic schema changes across all of Spanner. 1 Introduction Spanner is a scalable globally-distributed database designed built and deployed at Google. At the highest level of abstraction it is a database that shards data across many sets of Paxos 21 state machines in datacenters spread all over the world. Replication is used for global availability and geographic locality clients automatically failover between replicas. Spanner automatically reshards data across machines as the amount of data or the number of servers changes and it automatically migrates data across machines even across datacenters to balance load and in response to failures. Spanner is designed to scale up to millions of machines across hundreds of datacenters and trillions of database rows. Applications can use Spanner for high availability even in the face of wide-area natural disasters by replicating their data within or even across continents. Our initial customer was F1 35 a rewrite of Google s .