Spanner is adistributed SQL database management and storage service developed byGoogle.[1] It provides features such as global transactions, strongly consistent reads, and automatic multi-site replication and failover. Spanner is used inGoogle F1, the database for its advertising businessGoogle Ads, as well as Gmail and Google Photos.[2][3]
Spanner stores large amounts of mutable structured data. Spanner allows users to perform arbitrary queries using SQL with relational data while maintaining strong consistency and high availability for that data with synchronous replication.
Key features of Spanner:
Transactions can be applied across rows, columns, tables, and databases within a Spanner universe.
Clients can control the replication and placement of data using automatic multi-site replication and failover.
Replication is synchronous and strongly consistent.
Reads are strongly consistent and data is versioned to allow for stale reads: clients can read previous versions of data, subject to garbage collection windows.
Supports a native SQL interface for reading and writing data.
Spanner's SQL capability was added in 2017 and documented in aSIGMOD 2017 paper.[5] It became available as part ofGoogle Cloud Platform in 2017, under the name "Cloud Spanner".[6]
Spanner uses thePaxos algorithm as part of its operation toshard (partition) data across up to hundreds of servers.[1] It makes heavy use of hardware-assistedclock synchronization usingGPS clocks andatomic clocks to ensureglobal consistency.[1] TrueTime is the brand name for Google's distributed cloud infrastructure, which provides Spanner with the ability to generate monotonically increasing timestamps in data centers around the world.[7]