Compare CockroachDB and Google Spanner | Cockroach Labs

A comparison of the two Distributed SQL leaders

CockroachDB vs. Google Cloud Spanner

/* If you like Spanner, you’ll love CockroachDB. Learn more about the difference between them. */

Download the comparison

Why choose CockroachDB over Spanner?

Multiple clouds

Multiple clouds

CockroachDB can run anywhere, on any cloud, and even across multiple clouds and the hybrid cloud

Global transactions

Global transactions

CockroachDB has features like parallel commits and pipelining to optimize globally distributed transactions

Multi-region simplicity

Multi-region simplicity

CockroachDB provides simple DDL that allows you to define where data will live across multiple regions

CockroachDB and Spanner employ a similar distributed architecture; however, with CockroachDB you are free to deploy wherever and however you like.

Availability iconAvailability
GCP Only
All public clouds, on-prem and local
Architecture iconArchitecture
Architected to span globally distributed data centers, yet still valuable in a single data center
Architected to resiliently span globally distributed data centers, while still being valuable in a single data center
Distributed transactions iconDistributed transactions
Limited ability to optimize latency concerns for multi-region writes
Intelligent replication uses RAFT to place data and efficiently utilize available storage and compute resources
Multi-region writes iconMulti-region writes
Limited ability to optimize latency concerns for multi-region writes
Advances in parallel commits and transaction pipelining reduce broad geographic transaction latencies
Data residency iconData residency
Entire database lives in each region with no control at row level for survival/latency/compliance goals for data
Data is tied to a node at the row level to optimize performance and/or comply with data regulations
Hybrid and multi-cloud deployment iconHybrid and multi-cloud deployment
Tied to GCP instances only, no options for multi and/or hybrid cloud
Run anywhere on any cloud and even across regions and clouds
Pricing iconPricing
A la carte pricing for networking, storage and per-instance with limited availability
Simple, straightforward pricing, plus the ability to tie data to a location to avoid egress costs

Databases and platform freedom

CockroachDB is architected to give you the freedom to deploy your database anywhere and on
any cloud. You can use the best solution and still gain value from any cloud provider

Freedom from Lock-In

Make smart use of your existing resources with CockroachDB’s hybrid-cloud capabilities. Spanner won’t let you deploy in a hybrid environment.

Freedom of Choice

Pick any (or multiple) providers and run self-deployed or as-a-service. Because no one should have to be locked into a single provider

Freedom to Grow

Effortlessly scale and take control of your workloads. Avoid the significant egress costs often seen when moving data with Google Cloud Spanner.

5-minute matchup

Watch this bite-sized breakdown of the key differences between CockroachDB and Google Cloud Spanner.

CockroachDB vs Google Spanner

/* Distributed SQL or distributed storage? Learn the differences and decide with confidence */

Download the comparison