Google Spanner: Globally Distributed SQL at Scale

Google Spanner architecture combining relational model with horizontal scalability, TrueTime API for global consistency, and F1 database implementation.

published: reading time: 24 min read author: Geek Workbench updated: November 17, 2026
Quick Summary

Google Spanner combines a relational database model with horizontal scale and distributed transactions. Its TrueTime API returns a bounded time interval that Spanner uses to order commits; commit-wait helps preserve external consistency. Key-range design, replica placement, and workload shape affect performance, while Cloud Spanner costs depend on edition, configuration, compute, storage, replication, and network use.

Google Spanner: Globally Distributed SQL at Scale

Spanner combines a relational data model with distributed transactions across multiple machines and regions. Google’s 2012 research paper describes the system’s design; Cloud Spanner is Google Cloud’s managed database service. Its current service features and prices can change, so operational details below link to the current documentation.


Architecture Overview

Spanner arranges data in layers that blend traditional database concepts with distributed systems patterns.

Google’s research papers describe data organized into key ranges and replication groups; product implementation details can evolve. For current schema design, the Cloud Spanner documentation describes splits and how primary-key ranges distribute rows across servers. At a high level, a database contains tables and rows, while replication keeps data available across the configured locations.

graph TD
    A[Cloud Spanner Instance] --> B[Database 1]
    A --> C[Database 2]
    B --> D[Table: Users]
    B --> E[Table: Orders]
    D --> F[Directory: User Data]
    E --> G[Directory: Order Data]
    F --> H[Paxos Group - 3+ Replicas]
    G --> I[Paxos Group - 3+ Replicas]
    H --> J[Replica 1 - US East]
    H --> K[Replica 2 - US West]
    H --> L[Replica 3 - Europe]

Spanner stores data in tablets (inherited from Bigtable thinking). Each tablet spans a range of primary keys and is managed by a Paxos group. Paxos ensures all replicas agree before writes are acknowledged.


TrueTime: Global Consistency Through Clock Uncertainty

TrueTime is Spanner’s most distinctive feature. Google’s original Spanner paper describes an implementation that used GPS receivers and atomic clocks; the current Cloud Spanner documentation focuses on the interval API and the consistency guarantees built on top of it.

TrueTime does not claim clocks are perfectly synchronized. Instead, it makes clock uncertainty explicit as a bounded interval. Call TT.now() and you get back a TTinterval with earliest and latest possible timestamps:

# TrueTime returns a time interval, not a point
tt = TT.now()
# tt.earliest = timestamp that could be in the past
# tt.latest = timestamp that could be in the future
# The actual time is somewhere within this interval

TrueTime’s uncertainty is an interval, not a fixed 1–7 ms guarantee. Its width depends on the clock bounds available to the system and affects how long some commits must wait. Under Spanner’s default serializable isolation, external consistency means transactions behave as if serialized in an order that respects real-time completion: when one transaction finishes before another begins, the later transaction cannot be ordered before it.

For a read-write transaction, Spanner chooses a commit timestamp and uses commit-wait: it waits until TrueTime’s earliest possible time is later than that timestamp before reporting the commit. This lets the timestamp represent an event that has already occurred, even though the exact physical time is uncertain. If uncertainty grows, commit-wait can grow too; the consistency guarantee remains the same.

TrueTime is part of Google’s managed infrastructure; Cloud Spanner users work with its documented API and guarantees rather than operating the timekeeping system. Other distributed databases use different mechanisms for ordering transactions, so compare their documented guarantees instead of assuming they share TrueTime’s design.


Schema and SQL Support

Spanner gives you a relational schema with SQL. Unlike NoSQL systems that offer query capabilities as an afterthought, Spanner includes:

  • Standard SQL with JOINs, aggregations, subqueries
  • Inline primary keys and foreign keys
  • Interleaved tables for parent-child relationships
  • Generated columns and indexes
-- Spanner supports standard SQL with relational features
CREATE TABLE Users (
  UserId STRING(64) NOT NULL,
  Email STRING(256),
  CreatedAt TIMESTAMP,
) PRIMARY KEY (UserId);

CREATE TABLE Orders (
  OrderId STRING(64) NOT NULL,
  UserId STRING(64),
  Total DECIMAL(10,2),
  Status STRING(32),
) PRIMARY KEY (OrderId);

-- Foreign key support
ALTER TABLE Orders ADD CONSTRAINT FK_UserOrders
  FOREIGN KEY (UserId) REFERENCES Users(UserId);

-- Create index for common query pattern
CREATE INDEX idx_orders_user_status ON Orders(UserId, Status);

The INTERLEAVE IN clause co-locates related rows with their parent. This can help queries that read a parent and its children together, though it does not guarantee every query stays within one server or avoids all network communication.

Partition Key Design

Choosing a good primary key matters more in Spanner than in a single-node database. Since data is range-partitioned by key, a poorly chosen key creates hotspots that degrade performance.

Watch for monotonically increasing leading key values on write-heavy tables. Because Spanner distributes rows by key range, a high insert rate at the end of a key range can concentrate work on the active split and create a hotspot. This is workload-dependent: traffic rate, existing splits, and key distribution matter, and a sequential key does not automatically make every workload a hotspot. Google’s schema design guidance describes the risk and mitigation options.

-- Risky for a high-rate insert workload: application assigns increasing IDs
CREATE TABLE Events (
    event_id INT64 NOT NULL,
    payload STRING(MAX)
) PRIMARY KEY (event_id);

-- Example alternative: application supplies random UUID values
CREATE TABLE EventsByRandomId (
    event_id STRING(36) NOT NULL,
    payload STRING(MAX)
) PRIMARY KEY (event_id);

Choose the leading key based on the query patterns and write distribution you need. A user or customer ID can help group related reads, but if one key receives a large share of writes, that range can become a bottleneck. Benchmark with representative traffic and consult the current schema design guidance before adopting a key pattern.

Interleaved Tables

Interleaved tables can colocate child rows with parent rows in the same key range. This can help parent-child access patterns, though split boundaries and query shape mean a query is not guaranteed to be served by one server.

CREATE TABLE Orders (
    order_id STRING(36),
    customer_id STRING(36),
    total DECIMAL,
    created_at TIMESTAMP,
    PRIMARY KEY (order_id)
) PRIMARY KEY (order_id);

CREATE TABLE OrderItems (
    order_id STRING(36),
    item_id STRING(36),
    product_id STRING(36),
    quantity INT64,
    PRIMARY KEY (order_id, item_id)
) INTERLEAVE IN PARENT Orders ON DELETE CASCADE;

With INTERLEAVE IN PARENT Orders ON DELETE CASCADE, deleting an order also deletes its child rows. Interleaving can make parent-child access more local, but it does not guarantee a single-server query. Consider independent child access, write distribution, and the number of children per parent when choosing the schema; a heavily used key range can become a hotspot.


Transaction Handling

Spanner handles two transaction types: read-write and read-only.

Read-write transactions run two-phase commit (2PC) over Paxos. Nodes prepare first, promising to commit if asked. Then the coordinator tells them to commit or abort. This gives atomicity across distributed nodes, but adds latency.

Read-only transactions skip locks. They take a timestamp bound and read from consistent snapshots. No blocking, no contention.

Spanner also supports partitioned transactions for high-contention workloads, splitting large writes across servers for better throughput.

sequenceDiagram
    participant C as Coordinator
    participant P1 as Participant 1
    participant P2 as Participant 2

    Note over C,P2: Two-Phase Commit Protocol

    C->>P1: Prepare
    C->>P2: Prepare
    P1-->>C: Promise to Commit
    P2-->>C: Promise to Commit

    Note over C: Coordinator decides COMMIT

    C->>P1: Commit
    C->>P2: Commit
    P1-->>C: Committed
    P2-->C: Committed

Replication and Consistency

Spanner replicates data according to the instance configuration. Replica topology and optional read-only replicas vary by configuration and edition; use the current instance configuration documentation for supported layouts. Read consistency also depends on the operation: strong reads and timestamp-bounded stale reads have different behavior, described in the current read documentation.

Spanner provides external consistency for transactions using the default or serializable isolation level. If transaction T1 finishes before T2 begins, the system’s serial order places T1 before T2. This extends serializability by requiring the order to respect observable real-time completion. Commit-wait helps enforce that relationship: before reporting a read-write commit, Spanner waits until TrueTime’s earliest bound is later than the chosen commit timestamp. Applications using a different isolation level should check that level’s documented guarantees.


Direct Connections and Performance

Latency and throughput depend on the instance configuration, replica placement, transaction shape, key distribution, query plan, and client location. Avoid planning from one generic millisecond or QPS figure. Benchmark with representative data and transaction patterns, and use the Cloud Spanner documentation for current client and connection guidance.


Use Cases and Trade-offs

Spanner works well for:

  • Globally distributed databases needing strong consistency
  • Financial systems requiring ACID transactions across regions
  • Multi-tenant SaaS needing isolation and scalability
  • Inventory or order management with consistent cross-region updates

Shortcomings:

  • Cost: Not cheap compared to self-managed databases
  • TrueTime dependency: The managed service’s time API is part of Google’s infrastructure
  • Latency: Measure against the workload and replica configuration; there is no universal read-latency floor
  • Query requirements: Check SQL dialect support, indexes, and query plans against the workload

Failure and Availability Notes

Do not infer a fixed outage window or cached-read behavior from TrueTime uncertainty. Availability during a zone or network failure depends on the instance’s replica placement, the operation, and whether the required quorum is reachable. A partitioned component might be unable to serve a strongly consistent operation; Spanner’s consistency guarantees do not become weaker to make that operation succeed. Consult the current instance configuration and read consistency documentation for the configuration and read mode in use.

Higher TrueTime uncertainty can increase commit-wait; it is not a reason to serve stale data under a strong read or weaken external consistency. Google does not expose customer-managed TrueTime hardware, so this article does not prescribe internal clock monitoring or hardware replacement procedures.


Common Pitfalls / Anti-Patterns

Choose Spanner When

Spanner can fit applications that need distributed transactions and external consistency across regions. Under the default or serializable isolation level, commit timestamps preserve the real-time order of transactions that finish before another begins. This does not mean that every read from every region sees an identical snapshot at the same instant: read mode and timestamp matter. Financial, inventory, or collaborative workloads may benefit when their correctness requirements justify the added operational and cost considerations.

Horizontal scalability is another reason teams evaluate Spanner. The service can split and rebalance key ranges as data and load change, while compute capacity can be adjusted manually or with the managed autoscaler. Autoscaling is a configured option, and adding compute does not by itself resolve a hotspot or lock contention. Check the current schema and autoscaling documentation for details.

Cloud Spanner is a managed service: Google operates the underlying database infrastructure, while users choose instance configuration, replica locations, schema, compute capacity, and consistency options. Those choices affect availability, latency, and cost, so review the current configuration and compliance documentation rather than assuming one topology meets every requirement.

Regional and multi-region configurations place replicas in different locations. A configuration choice can support a data-residency plan, but it does not by itself establish regulatory compliance or guarantee availability during every failure.

The workloads that fit well include multi-region e-commerce platforms with inventory updates from warehouses worldwide, financial ledgers processing multi-currency transactions across time zones, SaaS applications serving globally distributed users writing to the same logical database, and gaming backends where players in different regions need consistent game state.

Scenario Why Spanner Fits
Multi-region OLTP with strong consistency External consistency across regions without reconciliation code
Application needs distributed scale Managed splitting and configurable compute capacity
Regulatory data residency requirements Regional configuration with cross-region disaster recovery
Mission-critical workload needing hands-off ops Managed replication, failover, and rebalancing
Globally distributed collaborative apps Transaction order can respect real-time completion under serializable isolation

Avoid Spanner When

Spanner is a poor fit when your workload does not need its defining features. If your application runs in one region and does not need Spanner’s distributed transaction model, compare it with databases whose deployment and pricing better fit that workload. The right choice depends on query patterns, operational requirements, consistency guarantees, and a current cost estimate.

Cost is one reason to compare Spanner with alternatives. Cloud Spanner pricing depends on edition, region and instance configuration, provisioned compute, database and backup storage, data replication, and network use. A price snapshot and a small worked example appear in the Cost Modeling section; use the live pricing page or calculator for a current estimate.

If a workload has a strict latency target, measure it with the intended schema, transaction pattern, client location, and instance configuration. There is no single latency floor that applies to every read or transaction. An in-memory store may suit a latency-sensitive cache or counter, while Spanner may fit workloads that also require relational queries and distributed transactional guarantees.

Advanced query optimization is another area where Spanner lags. Its SQL support is solid for standard OLTP queries, but PostgreSQL and MySQL have had decades of query planner refinement. Complex aggregations, parallel query execution, advanced indexing strategies, and JSON manipulation are better served by mature relational engines. If your workload is query-heavy with complex joins and you do not need global writes, PostgreSQL or its managed variants are the better choice.

Spanner is a Google Cloud service, so teams that require self-hosting or cloud-provider portability should include that constraint in their evaluation. Other distributed databases use different clock and transaction-ordering designs; compare the guarantees in each product’s current documentation instead of assuming equivalent behavior.

Scenario Better Alternative Why
Single-region OLTP PostgreSQL, Aurora, MySQL Lower cost, mature optimizer, richer ecosystem
Sub-millisecond latency needs Redis, Memcached In-memory speed, orders of magnitude lower latency
Query-heavy with complex joins PostgreSQL, analytical databases Decades of query planner refinement
Cost-sensitive at scale Self-managed PostgreSQL, CockroachDB Fraction of Spanner’s cost with similar guarantees
Open-source portability required CockroachDB, self-managed distributed DB HLC-based consistency without vendor lock-in

Decision Framework

flowchart TD
    A[Need Horizontal Scale?] --> |Yes| B[Need Global Distribution?]
    A --> |No| E[Consider PostgreSQL or MySQL]
    B --> |Yes| C[Need Strict Consistency?]
    B --> |No| F[Consider DynamoDB or Cassandra]
    C --> |Yes| D[Can Afford Premium Pricing?]
    C --> |No| F
    D --> |Yes| G[Spanner is a Strong Fit]
    D --> |No| H[Consider CockroachDB or Aurora Global]


Quick Recap Checklist

  • Spanner arranges data in directories (B-tree-like structures) grouped into Paxos groups for replication
  • TrueTime returns a bounded time interval; its uncertainty is not a fixed millisecond range
  • Commit-wait helps Spanner preserve external consistency for transactions using the default or serializable isolation level
  • Primary-key choice can concentrate high-rate writes on a key range; assess the workload and split behavior
  • Interleaving can colocate parent and child rows, with trade-offs for access patterns
  • Cloud Spanner prices depend on edition, location, configuration, compute, storage, replication, backup storage, and network use; see the dated example below

Interview Questions

1. What problem does Google Spanner solve, and how does it differ from traditional distributed databases?

Expected answer points:

  • Spanner solves the problem of globally distributed SQL: petabytes of data across data centers with relational model and ACID guarantees
  • Unlike early distributed databases that sacrificed consistency or the relational model, Spanner keeps both
  • TrueTime provides an interval-valued API that supports commit ordering; external consistency applies under the documented isolation conditions
2. Explain how TrueTime works and why its bounded uncertainty model matters for distributed consistency.

Expected answer points:

  • The original Spanner paper describes GPS receivers and atomic clocks; current Cloud Spanner docs describe TrueTime as an interval-valued API
  • The API returns earliest and latest possible timestamps rather than one exact time
  • Uncertainty varies; it is not a fixed millisecond guarantee and can affect commit-wait
  • Under default or serializable isolation, timestamps support transaction ordering that respects real-time completion
  • See the current TrueTime documentation for the managed service’s published guarantees
3. What is the commit-wait rule in Spanner, and how does it relate to TrueTime?

Expected answer points:

  • For a read-write transaction, Spanner waits until TrueTime’s earliest bound is later than the chosen commit timestamp before reporting commit
  • This makes the commit timestamp safe to use as an ordering point in real time
  • Wait duration depends on current uncertainty and is not covered by a fixed millisecond guarantee
  • External consistency applies with the default or serializable isolation level
4. How does Spanner's directory-based data model work, and how does it relate to Paxos groups?

Expected answer points:

  • The original Spanner paper describes directories as a data-placement unit in its architecture
  • It describes Paxos groups for replicated data; specific replica layouts vary with the managed instance configuration
  • Think of the diagram as the paper’s model, not a guarantee about current service internals
  • Current Cloud Spanner schema guidance describes tables, rows, key ranges, and splits
5. What is the difference between read-write and read-only transactions in Spanner?

Expected answer points:

  • Read-write transactions run two-phase commit (2PC) over Paxos: nodes prepare first, then coordinator tells them to commit or abort
  • Read-only transactions skip locks entirely and read from consistent snapshots at a timestamp bound
  • Read-only transactions have no blocking or contention, making them much faster for consistent reads
  • Spanner also supports partitioned transactions for high-contention workloads
6. Why is primary key design critical in Spanner, and what patterns should you avoid?

Expected answer points:

  • Spanner distributes rows by key range, so a high rate of writes concentrated at the end of a monotonically increasing key range can create a hotspot
  • The risk depends on workload rate, active key range, and split behavior; it is not a guarantee for every sequential-key workload
  • Random UUIDs, bit-reversed values, or other schema patterns can spread writes when that trade-off fits the query workload
  • For read-heavy tables, use the most frequently queried ID as the leading key
  • For write-heavy tables with many rows per user, consider composite keys with a suffix to spread writes
7. What are interleaved tables, when should you use them, and what are the trade-offs?

Expected answer points:

  • Interleaved tables can colocate child rows with parent rows in a split, which can help parent-child access patterns
  • They do not guarantee that every query is a single-server read
  • Consider the row distribution and read/write workload: a very active parent can concentrate work in a key range
  • Use `ON DELETE CASCADE` only when its semantics fit the application and expected delete size
  • Check current schema documentation for supported table relationships and their trade-offs
8. How does Spanner's Paxos-based replication work, and what is the role of the Paxos leader?

Expected answer points:

  • Spanner replicates data according to the selected instance configuration
  • Replica count and placement vary by configuration; optional read-only replicas are also available for some editions
  • Consensus and replica placement support durable writes, while read modes determine freshness and consistency
  • Use the current instance configuration and read documentation for details rather than assuming one topology
9. What does external consistency mean in Spanner, and how is it stronger than serializability?

Expected answer points:

  • With default or serializable isolation, transactions behave as if run in a serial order that respects real-time completion
  • If T1 finishes before T2 begins, T1 is ordered before T2; this adds a real-time requirement to serializability
  • For read-write commits, Spanner waits until TrueTime’s earliest bound is later than the commit timestamp
  • Other isolation levels have their own documented guarantees
10. What are Spanner's main limitations and when should you avoid using it?

Expected answer points:

  • Cost depends on edition, location, configured compute, storage, replication, backup retention, and network use
  • TrueTime is managed infrastructure; users do not operate its clocks
  • Latency depends on workload and configuration; benchmark before setting an SLO
  • Query plan and SQL feature requirements should be checked against current product documentation
  • Avoid choosing a globally distributed service when the workload does not need its consistency or scaling model
11. How does Spanner's two-phase commit work over Paxos, and what latency implications does it have?

Expected answer points:

  • Coordinator asks all participant nodes to prepare: they promise to commit if asked
  • Once a majority (Paxos group) promises, coordinator decides COMMIT
  • Coordinator tells all participants to commit, and they acknowledge
  • This adds latency compared to single-node commits: round trips between distributed nodes
  • Cross-region write latency depends on transaction participants, leader placement, network round trips, and configuration; benchmark the intended workload
12. What is the F1 database, and what does it demonstrate about Spanner's production readiness?

Expected answer points:

  • F1 is Google's ad business database that was migrated from Bigtable to Spanner
  • It validates Spanner can handle a real mission-critical workload: thousands of tables, complex joins, OLTP alongside analytical queries
  • Strict SLAs for latency and availability had to be met during and after migration
  • Proves Spanner is production-hardened, not just a research prototype
13. How does Spanner handle zone outages, and what guarantees does it provide during partial failures?

Expected answer points:

  • Availability depends on the configured replica topology and whether the operation can reach a quorum
  • Strong reads retain their documented consistency guarantees; TrueTime uncertainty does not turn them into stale reads
  • A component without the required quorum might not be able to serve a strongly consistent operation
  • Check the instance configuration and read consistency docs for the behavior of a specific deployment
14. How does Spanner's pricing work, and what are the main cost components?

Expected answer points:

  • Current pricing includes compute capacity, database storage, backup storage, cross-region replication, and some outbound network use
  • Compute rates vary by edition and configuration; storage and replication rates also depend on location
  • As a dated example, on 2026-11-17 the pricing page listed $0.90 per node-hour for a Standard regional instance in Iowa, including three replicas
  • For a 730-hour month, that example is $657 in compute before storage, backup, replication, network charges, or discounts
  • Recheck the [live pricing page](https://cloud.google.com/spanner/pricing) and calculator before budgeting
15. Compare Spanner with CockroachDB and Aurora on consistency, deployment, and global distribution.

Expected answer points:

  • Spanner: external consistency via TrueTime (GPS + atomic clocks), fully managed cloud, native multi-region
  • CockroachDB: serializability via HLC (no special hardware), self-hosted or cloud, native multi-region
  • Aurora: session + eventual consistency, AWS managed only, read replicas with Aurora Global for cross-region
  • Latency and price comparisons depend on release, edition, region, replica topology, transaction, and workload; do not compare systems using generic figures
  • Read each provider’s current documentation to compare consistency and deployment options for the exact use case
16. How does TrueTime uncertainty affect Spanner transactions?

Expected answer points:

  • TrueTime reports a bounded interval, and the interval width can vary
  • Higher uncertainty can increase commit-wait for read-write transactions
  • The service preserves its documented consistency guarantees; uncertainty does not make strong reads stale
  • TrueTime is managed by Google, so customers do not replace its internal clock hardware
17. What are the best practices for schema changes in Spanner, especially on large tables?

Expected answer points:

  • Add one column at a time rather than batching multiple changes
  • Avoid large DEFAULT values that increase write amplification
  • Check whether the specific change requires background data validation or index backfill; these operations can take longer on large databases
  • Spanner documents supported schema changes as online, but validation and constraints can affect writes while an update is in progress
  • Follow the current schema update guide for operation-specific behavior rather than assuming every DDL change has the same cost
18. What causes transaction conflict rate spikes in Spanner, and how should you mitigate them?

Expected answer points:

  • More retries and latency when concurrent transactions touch overlapping key ranges
  • Hotspots from poor primary key design or popular parent keys in interleaved tables exacerbate conflicts
  • Read-only transactions avoid write-lock contention, but they do not fix a hot write range or an expensive query
  • Structure key schema to reduce write contention: spread writes across key space
  • Consider partitioned transactions for large batch operations
19. How do strong and stale reads differ in Spanner?

Expected answer points:

  • A strong read observes effects of transactions that committed before the read began
  • A stale read uses a timestamp in the past and can avoid waiting for the latest state
  • Choose the read mode based on freshness requirements; do not describe stale reads as the default behavior of an isolated region
  • See the current Spanner read documentation for timestamp bounds and replica behavior
20. What factors determine whether to choose Spanner over PostgreSQL with read replicas for a given workload?

Expected answer points:

  • Consider Spanner when the workload needs distributed transactions, external consistency, or managed horizontal scale across the selected regions
  • Choose PostgreSQL with read replicas when: workload is single-region, cost-sensitive, or does not need global distribution
  • Spanner's managed operations eliminate database administration overhead but at premium pricing
  • PostgreSQL offers advanced query optimization and more mature ecosystem
  • Decision framework: need horizontal scale + global distribution + strict consistency + budget = Spanner; otherwise PostgreSQL

Further Reading


Operational Guidance

Backups and Point-in-Time Recovery

Spanner supports on-demand and scheduled database backups. New instances have a default daily backup schedule for new databases, which can be edited or disabled; it does not cover databases that already existed when the schedule was enabled. Point-in-time recovery is separate: databases retain earlier versions for one hour by default, and you can set the retention period up to seven days. Backups can be retained for up to a year and copied to another region or project. See the current backup documentation and PITR guide for configuration and limits.

Schema Updates and Scaling

Cloud Spanner schema updates do not require database downtime. Some updates need background validation or index backfill and can take minutes to hours depending on data volume and load. Review the supported operations and constraints in the current schema update guide before applying a change.

Compute capacity can be adjusted manually or through the managed autoscaler. Scaling can help when compute demand exceeds provisioned capacity, but it does not fix key-range hotspots or lock contention. See autoscaling guidance and benchmark the actual workload.


Cost Modeling

Cloud Spanner pricing includes compute capacity, database storage, backup storage, cross-region data replication, and some outbound network use. Rates vary by edition, region, and instance configuration; storage is billed by average use, and compute capacity is billed by provisioned capacity over time. Consult the current pricing page and pricing calculator before budgeting.

Price example checked 2026-11-17: The pricing page listed Standard regional compute in Iowa at $0.90 per node-hour, including all three replicas. One node running for 730 hours is $657 in compute. Regional SSD storage was listed at $0.000410959 per GiB-hour, including all three replicas; 100 GiB stored for 730 hours is about $30. This example excludes backups, cross-region replication, network use, discounts, and any differences in region or edition. Prices can change.

Conclusion

Cloud Spanner provides relational queries and distributed transactions, with external consistency available under the documented isolation conditions. TrueTime, replica placement, and key-range design are useful systems concepts, but current operations and costs should be planned from Google Cloud’s live documentation and a representative workload benchmark.

Category

Related Posts

Google Chubby: The Lock Service That Inspired ZooKeeper

Explore Google Chubby's architecture, lock-based coordination, Paxos integration, cell hierarchy, and its influence on distributed systems design.

#distributed-systems #databases #google

Synchronous Replication: Data Consistency Across Nodes

Learn about synchronous replication patterns in distributed databases, including Quorum-based replication and write-ahead log shipping for zero RPO.

#distributed-systems #replication #consistency

Consistency Models in Distributed Systems

Compare linearizable, sequential, causal, session, and eventual consistency using a stale-read timeline, safety and liveness, and application invariants.

#distributed-systems #system-design #consistency