vs

CockroachDB vs PostgreSQL

CockroachDB: Postgres-wire distributed SQL built to survive node, zone and region failures with serializable transactions. PostgreSQL: The extensible, standards-first open-source relational database.

key differences

  • Licensing: CockroachDB is source-available (CockroachDB Software License); PostgreSQL is open source (permissive) (PostgreSQL License).
  • CockroachDB is built for larger datasets (≤ 1 PB) than PostgreSQL (≤ 10 TB).
  • Horizontal scaling is native in CockroachDB and addon in PostgreSQL.
  • Only CockroachDB has ttl / expiry, encryption at rest, time travel.
  • Only PostgreSQL has pub/sub.
  • CockroachDB has a serverless option; PostgreSQL does not.

choose cockroachdb for

  • +Global payments and ledger systems of record
  • +Identity, account and session metadata across regions
  • +Inventory and order management with strict consistency
  • +Data-residency workloads that must pin rows to a country

best at · OLTP, Geo, Metadata

choose postgresql for

  • +General-purpose application backend
  • +SaaS multi-tenant data
  • +Geospatial applications with PostGIS
  • +Semantic search alongside relational data with pgvector

best at · OLTP, Geo, Search

overview
Primary model
Relational
Relational
Also supports
Document, Spatial, Vector
Document, Spatial
Type
Database engine
Database engine
Status
Active
Active
Developer
Cockroach Labs
PostgreSQL Global Development Group
First release
2015
1996
Latest version
26.3 (Aug 19, 2026)
18.6 (Aug 13, 2026)
License
Source-availableCockroachDB Software License
Open source (permissive)PostgreSQL License
Free tier
✓
✓
popularity
WhichDB Score
47.1
93.2
Rank
#33
#1
GitHub stars
32.6K
22.6K
Stack Overflow questions
467
178.8K
scale & guarantees
Comfortable data size
Large (≤ 1 PB)
Medium (≤ 10 TB)
Horizontal scaling
Native
Addon
Multi-region
Active active
Read replicas
ACID
Full
Full
Consistency
Strong
Strong
Schema
Strict
Strict
Architecture
Distributed, Multi primary, Client server, Serverless
Single node, Primary replica, Client server
deployment
Self-hosted
✓
✓
Vendor-managed cloud
✓
—
Serverless
✓
—
Embedded
—
—
Edge
—
—
Clouds
AWS, Google Cloud, Azure
AWS, Google Cloud, Azure, Oracle Cloud, IBM Cloud, Alibaba Cloud
capabilities
Transactions
✓
✓
Joins
✓
✓
Secondary indexes
✓
✓
Full-text search
✓
✓
Vector search
✓
✓
Geospatial
✓
✓
JSON
✓
✓
Change data capture
✓
✓
Triggers
✓
✓
Stored procedures
✓
✓
Materialized views
✓
✓
TTL / expiry
✓
—
Pub/Sub
—
✓
Columnar storage
—
—
In-memory
—
—
Durable persistence
✓
✓
Compression
✓
✓
Encryption at rest
✓
—
Role-based access
✓
✓
Time travel
✓
—
Branching
—
—
Online schema changes
✓
✓
Streaming ingest
—
—
Offline sync
—
—
Runs in WebAssembly
—
—
interfaces
Query languages
SQL, PL/pgSQL
SQL, PL/pgSQL
Client languages
Java, Go, Python, JavaScript, C#, Ruby, Rust, PHP
C, Java, Python, JavaScript, Go, Rust, C#, Ruby
Best for
OLTP, Geo, Metadata, Ledger
OLTP, Geo, Search, Content

CockroachDB vs PostgreSQL: FAQ

What is the difference between CockroachDB and PostgreSQL?

CockroachDB: Postgres-wire distributed SQL built to survive node, zone and region failures with serializable transactions. PostgreSQL: The extensible, standards-first open-source relational database. Licensing: CockroachDB is source-available (CockroachDB Software License); PostgreSQL is open source (permissive) (PostgreSQL License). CockroachDB is built for larger datasets (≤ 1 PB) than PostgreSQL (≤ 10 TB). Horizontal scaling is native in CockroachDB and addon in PostgreSQL.

When should I choose CockroachDB over PostgreSQL?

Choose CockroachDB for global payments and ledger systems of record; identity, account and session metadata across regions; and inventory and order management with strict consistency. Choose PostgreSQL for general-purpose application backend, SaaS multi-tenant data and geospatial applications with PostGIS.

Is CockroachDB or PostgreSQL more popular?

PostgreSQL ranks #1 on the WhichDB Score (93.2/100) and CockroachDB ranks #33 (47.1/100). Popularity is not fit: check the requirements that matter for your project.

Are CockroachDB and PostgreSQL open source?

Not in the OSI sense. CockroachDB is source-available: you can read the code, but the license restricts some uses, typically offering it as a competing managed service. License: CockroachDB Software License. Yes. PostgreSQL is open source. License: PostgreSQL License.