Google Cloud Spanner
activeby Google · since 2017 · also known as Spanner, Cloud Spanner
Google's globally consistent, horizontally scaling SQL service with graph, vector and full-text built in.
Overview
Spanner is Google Cloud's fully managed distributed SQL database, the external version of the system that backs Google's own ads and payments infrastructure. It shards data automatically, replicates it with Paxos, and uses TrueTime-synchronized clocks to give externally consistent transactions across regions with a 99.999% SLA on multi-region configurations. Beyond relational tables it now offers Spanner Graph (ISO GQL), vector search, full-text search and a PostgreSQL-dialect interface. Choose it when you need effectively unlimited write scale with strong consistency and are comfortable committing to Google Cloud; for small apps its minimum footprint and pricing are hard to justify.
Strengths & trade-offs
Strengths
- +External consistency across regions backed by TrueTime and Paxos
- +No manual sharding: splits and rebalancing happen automatically
- +99.999% availability SLA on multi-region configurations
- +Graph (GQL), vector and full-text search in the same database
- +Stale reads and point-in-time recovery up to the version retention window
- +Online schema changes with no maintenance windows
Trade-offs
- −Google Cloud only for the managed service (Spanner Omni is the self-run option)
- −Expensive at small scale compared with Cloud SQL or Postgres
- −No triggers or stored procedures; PostgreSQL dialect is a subset
- −Schema and key design (interleaving, avoiding hotspots) matters a lot for performance
Great for
- +Global financial ledgers and payment systems
- +Gaming backends with worldwide player state
- +Inventory and supply-chain systems of record
- +Identity and metadata services at very high write rates
- +Graph-plus-relational fraud detection
Think twice for
- −Small or hobby applications on a tight budget
- −Multi-cloud or on-premises requirements (consider Spanner Omni)
- −Heavy procedural logic in the database
Capabilities
Native or official first-party support · 14 of 25 tracked
Scale & consistency
- Comfortable data size
- Massive · Multi-PB
- Horizontal scaling
- Native
- Multi-region
- Active active
- Transactions
- Full ACID
- Consistency
- Strong
- Schema
- Strict
- Architecture
- Distributed, Multi primary
- Query languages
- GoogleSQL, PostgreSQL dialect, GQL
Automatic split-based sharding; granular instances start at 100 processing units; multi-region configs offer 99.999% availability.
Deployment
available on · Google Cloud
Ecosystem
Alternatives to Google Cloud Spanner
Postgres-wire distributed SQL built to survive node, zone and region failures with serializable transactions.
google-cloud-spanner vs cockroachdb →Apache-licensed distributed SQL that reuses the PostgreSQL query layer on a Raft-replicated storage engine.
google-cloud-spanner vs yugabytedb →Serverless, active-active distributed SQL on AWS with PostgreSQL compatibility and no instances to size.
google-cloud-spanner vs amazon-aurora-dsql →Downloadable Spanner that runs on your own servers, other clouds or a laptop, with Paxos and auto-sharding.
google-cloud-spanner vs spanner-omni →MySQL-compatible distributed SQL with a row store for OLTP and a columnar replica for real-time analytics.
google-cloud-spanner vs tidb →Microsoft's globally distributed, multi-API NoSQL and vector database with SLA-backed latency.
google-cloud-spanner vs azure-cosmos-db →Google Cloud Spanner FAQ
What is Google Cloud Spanner?
Google Cloud Spanner is a relational database by Google, first released in 2017. Spanner is Google Cloud's fully managed distributed SQL database, the external version of the system that backs Google's own ads and payments infrastructure. It shards data automatically, replicates it with Paxos, and uses TrueTime-synchronized clocks to give externally consistent transactions across regions with a 99.999% SLA on multi-region configurations. Beyond relational tables it now offers Spanner Graph (ISO GQL), vector search, full-text search and a PostgreSQL-dialect interface. Choose it when you need effectively unlimited write scale with strong consistency and are comfortable committing to Google Cloud; for small apps its minimum footprint and pricing are hard to justify.
Is Google Cloud Spanner open source?
No. Google Cloud Spanner is proprietary, closed-source software.
Does Google Cloud Spanner support ACID transactions?
Yes. Google Cloud Spanner supports full ACID transactions, with strong consistency.
Does Google Cloud Spanner scale horizontally?
Google Cloud Spanner scales horizontally out of the box, with built-in sharding or partitioning. It is comfortable at massive scale (Multi-PB). It supports active-active multi-region writes.
How can I run Google Cloud Spanner?
You can use the vendor's managed cloud. Managed offerings include Spanner. It is available on Google Cloud.
What is Google Cloud Spanner best for?
Google Cloud Spanner is a strong fit for global financial ledgers and payment systems; gaming backends with worldwide player state; and inventory and supply-chain systems of record. Think twice for small or hobby applications on a tight budget.
What are the best alternatives to Google Cloud Spanner?
Common alternatives to Google Cloud Spanner include CockroachDB, YugabyteDB, Amazon Aurora DSQL, Google Spanner Omni and TiDB. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.
How popular is Google Cloud Spanner?
Google Cloud Spanner ranks #59 of 844 databases on the WhichDB Score (34.5/100), and #18 among relational databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.