PostgreSQL vs CockroachDB
PostgreSQL wins because it's a real database, not a distributed systems experiment. CockroachDB is for people who think they need global scale but actually need better architecture.
The short answer
PostgreSQL over CockroachDB for most cases. PostgreSQL wins because it delivers 95% of what developers actually need without the complexity tax.
- Pick PostgreSQL if building a business application, SaaS product, or anything that doesn't process financial transactions across continents simultaneously. PostgreSQL handles 50TB datasets on single instances now—you probably don't need distributed
- Pick CockroachDB if building a global financial platform that must process transactions in New York and Singapore simultaneously with zero data loss. Everyone else is pretending
- Also consider: CockroachDB's sales pitch preys on scale anxiety. Most companies hit PostgreSQL's limits because of poor schema design or missing indexes, not database capabilities. Fix your queries before switching architectures.
— Nice Pick, opinionated tool recommendations
The Setup Reality Check
PostgreSQL can be running in production in under 5 minutes on any cloud provider or your laptop. CockroachDB requires a minimum 3-node cluster just to start, which means you're immediately paying for 3x the infrastructure before writing your first query. The operational overhead of managing a distributed consensus protocol (Raft) versus a single PostgreSQL instance isn't just different—it's a completely different job description. If your team doesn't have dedicated distributed systems engineers, you're going to spend more time debugging CockroachDB's topology than building features.
The Performance Lie
CockroachDB claims 'linear scalability' but conveniently omits that every cross-node transaction adds 5-10ms of latency due to consensus overhead. Their own benchmarks show 2,500 TPS on a 9-node cluster for TPC-C—PostgreSQL on a single beefy machine does 15,000+ TPS for typical web workloads. The distributed architecture means every JOIN potentially crosses network boundaries, turning O(n) queries into O(n²) latency nightmares. CockroachDB's performance only makes sense when your data physically cannot fit on one machine, which for 99% of applications means never.
Pricing: The Hidden Tax
PostgreSQL is free on any cloud VM starting at $15/month. CockroachDB's cheapest production-ready option is their Dedicated tier at $73/month per node—minimum 3 nodes = $219/month before you store a single byte. Their Serverless tier seems cheap at $0.50/GB-month until you realize every query consumes Request Units, and a simple 3-table JOIN can cost 50x more than the same query on PostgreSQL. CockroachDB's pricing model assumes you need multi-region replication; if you don't, you're paying a 300-500% premium for features you'll never use.
Ecosystem: Maturity vs Marketing
PostgreSQL has 30+ years of extensions: PostGIS for geospatial, TimescaleDB for time-series, pgvector for AI embeddings—all battle-tested. CockroachDB's PostgreSQL compatibility is 85% at best; missing critical features like full text search configurations, certain JSON operators, and extension support. Want to use a popular ORM like Prisma or Sequelize? With PostgreSQL it's plug-and-play. With CockroachDB you're reading GitHub issues about unsupported query patterns and edge cases. The ecosystem gap isn't closing—it's widening as PostgreSQL accelerates.
When Scale Actually Matters
CockroachDB makes sense exactly once: when you need strong consistency across multiple cloud regions with active-active writes. That's it. If you're not processing financial transactions in us-east-1 and eu-west-1 simultaneously with zero RPO, you don't need it. PostgreSQL with logical replication or read replicas handles 99% of global scale needs. The switch to CockroachDB should happen after you've exhausted PostgreSQL's partitioning, connection pooling, and read replica options—which for most companies means never.
The Migration Trap
Migrating from PostgreSQL to CockroachDB seems easy until you hit the 15% of queries that don't work. Window functions with specific framing? Different behavior. Certain isolation levels? Implemented differently. Backup/restore tools? Proprietary format. Once you're in CockroachDB's ecosystem, there's no easy way back—your application becomes dependent on their distributed SQL dialect. Meanwhile, PostgreSQL to PostgreSQL migrations between versions or providers are trivial. Vendor lock-in isn't a risk with CockroachDB; it's the product.
Quick Comparison
| Factor | PostgreSQL | CockroachDB |
|---|---|---|
| Entry Cost | $15/month (single cloud VM) | $219/month (3-node minimum cluster) |
| Cross-Region Latency | N/A (single region by design) | Adds 5-10ms per cross-node transaction |
| PostgreSQL Compatibility | 100% (it is PostgreSQL) | ~85% (missing extensions, certain SQL features) |
| Horizontal Scaling | Manual (sharding, read replicas) | Automatic (built-in distribution) |
| Multi-Region Active-Active | Not natively supported | Native with strong consistency |
| Ecosystem Extensions | 50+ mature extensions (PostGIS, Timescale, etc.) | Limited extension support |
| Operational Complexity | Standard DBA skills required | Distributed systems expertise required |
| Maximum Single-Node Throughput | 15,000+ TPS (web workload) | Limited by network consensus overhead |
The Verdict
Use PostgreSQL if: You're building a business application, SaaS product, or anything that doesn't process financial transactions across continents simultaneously. PostgreSQL handles 50TB datasets on single instances now—you probably don't need distributed.
Use CockroachDB if: You're building a global financial platform that must process transactions in New York and Singapore simultaneously with zero data loss. Everyone else is pretending.
Consider: CockroachDB's sales pitch preys on scale anxiety. Most companies hit PostgreSQL's limits because of poor schema design or missing indexes, not database capabilities. Fix your queries before switching architectures.
PostgreSQL wins because it delivers 95% of what developers actually need without the complexity tax. CockroachDB's distributed architecture adds latency, cost, and operational headaches that most applications will never justify. PostgreSQL's mature ecosystem, predictable performance, and actual ACID compliance make it the obvious choice for anyone not running a multinational bank.
Related Comparisons
Disagree? nice@nicepick.dev