Introduction
In our last lesson, we delved into Spanner's schema design, discovering how its relational model and features like interleaved tables give developers fine-grained control over physical data locality. This design is not accidental; it's a core part of how Spanner achieves its primary goal: providing strong transactional guarantees at a global scale. This naturally leads to the question of what came before Spanner and why a new system was needed.
This lesson addresses that question by tackling the learning outcome: Compare Bigtable and Spanner in terms of their data models, consistency guarantees, and primary use cases. We will explore Google's foundational NoSQL database, Bigtable, and place it side-by-side with Spanner. Understanding the fundamental trade-offs between these two behemoths is essential for a Principal Engineer, as it forms the basis for making critical architectural decisions about which storage system to use for a given large-scale application.
The Genesis of Spanner: Limitations of Bigtable
To understand Spanner, one must first understand the problems it was designed to solve. Bigtable was, and still is, a massively successful and scalable storage system. However, as applications at Google grew in complexity, some of its design choices became challenging for developers. Spanner was born from a desire to address these challenges directly.
Spanner: Google's Globally-Distributed Database
The original Spanner paper provides the best motivation for its existence. It explicitly outlines the feedback Google's engineers had about Bigtable and another system, Megastore.
In Section 1, read the paragraph that begins with this text. Pay close attention to the user complaints about Bigtable regarding "complex, evolving schemas" and the need for "strong consistency in the presence of wide-area replication." This sets the stage for the entire comparison.
This passage highlights the core tension: Bigtable offered immense scalability and a flexible data model, but at the cost of shifting the burden of managing data relationships and consistency to the application layer. Spanner was engineered to bring the power of the relational model and strong consistency to that same massive scale.
Data Model: Flexibility vs. Structure
The most immediate difference between the two systems lies in their data models. This choice fundamentally dictates how you structure your data and what capabilities the database provides for querying and manipulation.
Bigtable: The Wide-Column Store
Bigtable pioneered the "wide-column" NoSQL data model. It is best understood not as a relational database, but as a sparse, distributed, persistent, multi-dimensional sorted map.
The key to this map is a composite of three things:
- Row Key: An arbitrary string that uniquely identifies an entity. All data in Bigtable is lexicographically sorted by this key, a crucial feature for optimizing scan performance by co-locating related rows.
- Column Key: Columns are grouped into column families. A full column key is of the form
family:qualifier. A table can have a small number of families but a virtually unbounded number of columns. - Timestamp: Each cell
(row, column)can have multiple versioned values, indexed by a 64-bit integer timestamp.
The value associated with each key is simply an uninterpreted array of bytes.
Bigtable: A Distributed Storage System for Structured Data
The original Bigtable paper provides the canonical description of its data model.
Please read Section 2, Data Model. Focus on the definitions of the core map, and the detailed explanations of Rows, Column Families, and Timestamps. This will solidify your understanding of its structure.
This model is incredibly flexible. You can have rows with millions of columns, and other rows in the same table with only a few. There is no rigid schema enforcement beyond the definition of column families. This is powerful but places the responsibility on the application to interpret the data.
Spanner: The Relational Model at Scale
Spanner, as we saw in the previous lesson, presents a familiar relational model.
- Data is stored in schematized tables with typed columns, rows, and primary keys.
- It supports secondary indexes and, most critically, a SQL-based query language.
- Relationships between tables can be explicitly declared and physically enforced using
INTERLEAVE INdeclarations to ensure data locality.
While internally Spanner builds upon some of the same key-value concepts as Bigtable, the abstraction it presents to the developer is that of a full-featured relational database.
This image provides a high-level summary of the differences between several Google Cloud storage services.

Consistency Guarantees: The Great Divide
The difference in data models hints at a deeper, more profound difference in consistency guarantees. This is arguably the most important distinction between the two systems.
Bigtable: Single-Row Atomicity
Bigtable provides strong consistency for operations on a single row.
- Single-Row Transactions: Any number of reads and writes to a single row key are atomic. A client will never see a partially updated row.
- No Cross-Row Transactions: Bigtable does not provide multi-row, multi-table transactions. If you need to update two different rows (e.g., debiting one account and crediting another) and have it be atomic, you must build that logic into your application, which is a non-trivial distributed systems problem.
- Eventual Consistency for Replication: When data is replicated across different clusters (datacenters), the replication is asynchronous. Changes made in one cluster will eventually appear in others, but there is a replication lag.
Bigtable: A Distributed Storage System for Structured Data
The API section of the Bigtable paper clarifies its transactional capabilities.
Please read the first paragraph of Section 3, API, focusing on the sentence that explicitly defines its transactional support: "Bigtable supports single-row transactions...".
Spanner: Global External Consistency
Spanner's primary mission is to provide much stronger guarantees.
- External Consistency (Linearizability): Spanner provides externally consistent (or linearizable) distributed transactions. This means if transaction T1 completes before transaction T2 begins, the effects of T1 are guaranteed to be visible to T2, regardless of where they execute in the world. This is the strongest single-system consistency model.
- ACID Transactions: Spanner supports fully general ACID transactions spanning arbitrary rows, tables, and datacenters.
- TrueTime API: This is achieved through a novel clock API called TrueTime, which uses GPS and atomic clocks to know the time with a bounded, quantifiable uncertainty. By waiting out this uncertainty, Spanner can assign globally meaningful timestamps to transactions and guarantee their order, a topic we will explore in depth in the next module.
Spanner - The Perfect Database? | Distributed Systems Deep Dives With Ex-Google SWE
This video offers an excellent conceptual overview of external consistency and how Spanner's use of time differs from other systems.
First, watch the explanation of causal and external consistency. This clarifies the difference between the guarantees provided by Lamport clocks and the stronger linearizability that Spanner achieves. Then, watch the segment on distributed clocks and TrueTime, which introduces the core idea of representing time as an interval of uncertainty.
This ability to perform ACID transactions across the globe is what makes Spanner revolutionary. It allows developers to build globally distributed applications using the familiar transactional logic of a traditional single-node RDBMS.
Use Cases: Throughput vs. Transactions
The differences in data model and consistency lead directly to different sweet spots for each system.
Bigtable: High-Throughput Analytics and Big Data
Bigtable is the tool of choice when you need to ingest and process massive volumes of data at extremely high throughput, and your access patterns are either key-based lookups or scans over contiguous row ranges.
Typical use cases include:
- Time-series data: Monitoring metrics, IoT sensor data, financial market data. The
(row_key, timestamp)model is a natural fit. - Large-scale analytics: As a data source and sink for batch processing pipelines using frameworks like MapReduce or Beam. Google Analytics is a classic example.
- Personalization: Storing user profiles and event streams for generating recommendations.
This Google Cloud video gives a concise summary of Bigtable's strengths and ideal use cases.
Watch the overview from the introduction to its scalability to understand its positioning for large analytical and operational workloads. Then, pay close attention to the direct comparison with Spanner from the beginning of the comparison section.
Spanner: Global Systems of Record
Spanner shines when you are building the "system of record" for a business process that requires strong consistency, even if it is distributed globally. Think of any application where you would traditionally reach for a relational database like MySQL or PostgreSQL, but need it to scale horizontally and be fault-tolerant across regions.
Typical use cases include:
- Financial and Ad Tech Systems: Google's own F1 ads backend is the canonical example, moving from a complex sharded MySQL setup to Spanner to simplify operations and maintain strong consistency.
- Global Inventory and E-commerce: Systems that need to track inventory and process orders transactionally across a global user base.
- Gaming: Leaderboards and player state management that require consistent updates across many users.
Spanner: Google's Globally-Distributed Database
The F1 case study in the Spanner paper is the definitive example of its primary use case.
Please read Section 5.4, F1. Your background in distributed systems and sharding will make the pain points described with sharded MySQL very familiar. Note the reasons the team chose Spanner: removing manual resharding, gaining synchronous replication, and requiring strong transactional semantics.
Architectural Summary
At a high level, both systems share some heritage, leveraging a distributed file system (GFS/Colossus) for durable storage and a coordination service (Chubby) for metadata and locking.

Bigtable's architecture is a masterful implementation of a scalable key-value store. Spanner takes that foundation and adds a sophisticated, globally-aware transaction manager, powered by Paxos consensus within each data shard and orchestrated by the TrueTime API. This additional complexity is the price paid for its powerful consistency guarantees.
Conclusion
In this lesson, we've dissected the core differences between two of Google's most important contributions to distributed storage. Choosing the right one is a critical architectural decision that hinges on a clear understanding of your application's needs.
Here are the key takeaways:
- Data Model: Bigtable offers a flexible, schema-light wide-column model (NoSQL). Spanner provides a structured, schema-enforced relational model with a SQL interface.
- Consistency: Bigtable guarantees atomicity only at the single-row level and has eventually consistent replication. Spanner delivers globally distributed, externally consistent ACID transactions.
- Primary Use Case: Bigtable is optimized for high-throughput analytical workloads, time-series data, and batch processing. Spanner is designed for transactional "systems of record" that require strong consistency at global scale.
As a Principal Engineer, you aren't just choosing features; you're evaluating a fundamental trade-off. Spanner provides stronger guarantees and a more familiar developer model (SQL, transactions), simplifying application logic. Bigtable provides greater schema flexibility and potentially higher raw throughput for certain workloads, but requires the application to handle more complex consistency and data modeling challenges.
This comparison sets the stage perfectly for our next module, Advanced Distributed Transactions. We will begin by analyzing the two-phase commit (2PC) protocol, a foundational algorithm for achieving atomicity across multiple participants, and a key component in how systems like Spanner coordinate their distributed transactions.