Spanner Logo

A comparison of the two Distributed SQL leaders

CockroachDB vs. Google Spanner

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

Why choose CockroachDB over Spanner?

Multiple Cloud Icon

Multiple clouds

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

Global transaction icon

Global transactions

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

Multi region Simplicity icon

Multi-region simplicity

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

Compare side-by-side

image
image
Availability
GCP Only
All public clouds, on-prem and local
Architecture
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
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
Limited ability to optimize latency concerns for multi-region writes
Advances in parallel commits and transaction pipelining reduce broad geographic transaction latencies
Data 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
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
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

Download the comparison

/* Save and share a PDF breakdown of how Google Spanner stacks up against multi-cloud CockroachDB. */