Reading the Google Spanner Paper
I read the Google Spanner paper, Spanner: Google’s Globally-Distributed Database, so I’m going to share my take on it. We’ll focus on its essence rather than covering every detail, so we can get an overview of what Spanner is, what makes it powerful, and how it works. Google Spanner TL;DR Google already had Bigtable and Megastore, but both had limitations. Bigtable was difficult to use for applications requiring complex schemas or strong consistency across datacenters. Megastore provided a semi-relational data model and synchronous replication, but its write throughput was relatively low. Spanner combines automatic sharding, synchronous replication, serializable distributed transactions, and SQL-based queries in a globally distributed database. One of its key features is external consistency: the order of transactions respects the order in which they happen in the real world. To achieve this, Spanner uses TrueTime, a novel clock API that exposes bounded clock uncertainty. TrueTime also helps Spanner support lock-free read-only transactions and globally consistent snapshot reads. Architecture Although Spanner supports SQL-like queries, its underlying storage is more like a distributed key-value store. Data is stored as versioned key-value pairs. Let’s look at how Spanner organizes and replicates this data. ...