ArticleslgStudy

computer science

Spanner (database)

Spanner (database) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Spanner (database) rather than just read about it. In short: Spanner is a distributed SQL database management and storage service developed by Google. It provides features such as global transactions, strongly consistent reads, and automatic multi-site replication and failover.

Spanner (database) — main illustration
Spanner (database) — illustration

Key takeaways

  • Spanner (database) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Spanner (database) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Spanner (database) from memory before moving on to harder problems.

Reference excerpt

Spanner is a distributed SQL database management and storage service developed by Google. It provides features such as global transactions, strongly consistent reads, and automatic multi-site replication and failover. Spanner is used in Google F1, the database for its advertising business Google Ads, as well as Gmail and Google Photos.

Features 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. Support for Graph Query Language

History Spanner was first described in 2012 for internal Google data centers. Spanner's SQL capability was added in 2017 and documented in a SIGMOD 2017 paper. It became available as part of Google Cloud Platform in 2017, under the name "Cloud Spanner".

Architecture Spanner uses the Paxos algorithm as part of its operation to shard (partition) data across up to hundreds of servers. It makes heavy use of hardware-assisted clock synchronization using GPS clocks and atomic clocks to ensure global consistency. 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. Google's F1 SQL database management system (DBMS) is built on top of Spanner, replacing Google's custom MySQL variant.

References

Bibliography Corbett, James C; Dean, Jeffrey; Epstein, Michael; Fikes, Andrew; Frost, Christopher; Furman, JJ; Ghemawat, Sanjay; Gubarev, Andrey; Heiser, Christopher; Hochschild, Peter; Hsieh, Wilson; Kanthak, Sebastian; Kogan, Eugene; Li, Hongyi; Lloyd, Alexander; Melnik, Sergey; Mwaura, David; Nagle, David; Quinlan, Sean; Rao, Rajesh; Rolig, Lindsay; Saito, Yasushi; Szymaniak, Michal; Taylor, Christopher; Wang, Ruth; Woodford, Dale (2012). Spanner: Google's Globally-Distributed Database (PDF). 10th USENIX Symposium on Operating Systems Design and Implementation (OSDI'12). Hollywood, CA. Retrieved 18 September 2012.{{cite conference}}: CS1 maint: ref duplicates default (link). Date, Christopher ‘Chris’ J (2004), "6. Relations, Part II. The Relational Model", An Introduction to Database Systems (8th ed.), Addison Wesley, ISBN 978-0-32119784-9. Shute, Jeffrey ‘Jeff’; Oancea, Mircea; Ellner, Stephan; Handy, Benjamin ‘Ben’; Rollins, Eric; Samwel, Bart; Vingralek, Radek; Whipkey, Chad; Chen, Xin; Jegerlehner, Beat; Littlefield, Kyle; Tong, Phoenix (2012), "F1 — the Fault-Tolerant Distributed RDBMS Supporting Google's Ad Business", Research (presentation), SIGMOD{{citation}}: CS1 maint: location missing publisher (link). Shute, Jeffrey ‘Jeff’; Oancea, Mircea; Ellner, Stephan; Handy, Benjamin ‘Ben’; Rollins, Eric; Samwel, Bart; Vingralek, Radek; Whipkey, Chad; Rae, Ian; Apte, Himani; Littlefield, Kyle; Cieslewicz, John (2013), "F1: A Distributed SQL Database That Scales", Research (presentation), International Conference on Very Large Data Bases{{citation}}: CS1 maint: location missing publisher (link).

Further reading Clark, Jack (30 Aug 2013). "Google goes back to the future with SQL F1 database". www.theregister.com.

Illustrations

Spanner (database): Cloud Spanner Booth at Google Cloud Summit
Cloud Spanner Booth at Google Cloud Summit

Worked examples

Example 1 — a first encounter with Spanner (database)

Start with the simplest possible case. Write down what Spanner (database) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Spanner (database) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Spanner (database) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Spanner (database)

In research
Spanner (database) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Spanner (database) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Spanner (database) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Cloud databases, Databases, Distributed computing, so understanding it makes those chapters shorter.
In everyday life
Look for Spanner (database) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Spanner (database)” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Spanner (database) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Spanner (database) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Spanner (database) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Spanner (database) in simple terms?

Spanner is a distributed SQL database management and storage service developed by Google. It provides features such as global transactions, strongly consistent reads, and automatic multi-site replication and failover.

Why does Spanner (database) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Spanner (database)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Spanner (database).

Tags

  • Cloud databases
  • Databases
  • Distributed computing
  • Distributed data stores
  • Google software
  • NewSQL

Keep exploring