Skip to content

Database Comparison — PostgreSQL vs MySQL vs CockroachDB

Canonical comparison of the three dominant relational database systems.

Quick Reference

Dimension PostgreSQL MySQL CockroachDB
Latest Version v18.3 (Feb 2026) 8.4 LTS / 9.x Innovation v26.1 (2026)
Architecture Single-node (primary + replicas) Single-node (primary + replicas) Distributed (multi-node, symmetric)
Scaling Model Vertical (read replicas for reads) Vertical (read replicas, Group Repl.) Horizontal (automatic sharding)
Consistency Strong (single node) Strong (single node) Serializable (distributed)
Wire Protocol PostgreSQL MySQL PostgreSQL-compatible
License PostgreSQL (MIT-like) GPL 2.0 / Commercial BSL 1.1 / CCL
Company Community Oracle Cockroach Labs

Feature Matrix

Feature PostgreSQL MySQL CockroachDB
ACID ✅ Full ✅ Full (InnoDB) ✅ Serializable
JSON/Document ✅ JSONB (binary, indexed) ✅ JSON ✅ JSONB (PG compat)
Full-text search ✅ Built-in ✅ Built-in ⚠️ Basic
Geo/Spatial ✅ PostGIS ✅ Spatial ✅ Built-in
Vector search ✅ pgvector extension ❌ (HeatWave GenAI) ✅ Built-in (v26.1)
Async I/O ✅ io_uring (v18)
Horizontal write scaling ❌ (Citus extension) ❌ (Group Repl. limited) ✅ Native
Multi-region active-active ✅ Native
Survive datacenter failure ❌ (manual failover) ❌ (manual failover) ✅ Automatic
Online DDL ⚠️ (some locking) ✅ (InnoDB online DDL) ✅ Zero-downtime
Logical replication ✅ (v18 improved) ✅ CDC
Extensions ✅ Rich (PostGIS, TimescaleDB, etc.) ⚠️ Limited

Performance Positioning

Workload Best Choice
Single-node OLTP PostgreSQL (fastest with AIO v18)
Single-node mixed OLTP+OLAP MySQL HeatWave (if Oracle OK)
Read-heavy, many replicas PostgreSQL or MySQL
Write-heavy, global distribution CockroachDB
Multi-region, data sovereignty CockroachDB
AI/vector search PostgreSQL (pgvector) or CockroachDB

Decision Guide

Scenario Recommendation
General-purpose backend PostgreSQL — most features, most extensions
WordPress / PHP ecosystem MySQL — deepest PHP/Laravel integration
Global application, multi-region CockroachDB — survive anything
Maximum OLTP performance (single-region) PostgreSQL 18 — AIO + io_uring
Combined OLTP + analytics MySQL HeatWave (managed) or PG + TimescaleDB
Regulatory data sovereignty CockroachDB — geo-partitioned data
Budget-conscious, open-source PostgreSQL (most permissive license)
Existing MySQL workloads MySQL 8.4 LTS → plan 9.x migration

Sources

  • Cross-validated via official docs and release notes (April 2026)