Postgres or MySQL by Workload: A Decision Matrix for 2026
Not all workloads are equal. Here is the honest answer by workload type, with named real-world precedents.
New SaaS / web app
PostgresEcosystem velocity (Heroku, Render, Supabase, Neon, Railway all default Postgres), feature richness (JSONB, CTEs, PostGIS), governance (no Oracle). The Stack Overflow Developer Survey has Postgres as most admired DB since 2022.
Read-heavy CRUD
Either; lean PostgresBoth handle CRUD well. Postgres has a planner advantage on complex queries. MySQL InnoDB's clustered index gives a slight edge on simple primary-key lookups at high concurrency. Unless you have a MySQL-specific reason, default Postgres.
Analytics / OLAP
Postgres + Citus / DuckDB (or HeatWave if on OCI)Open ecosystem: Postgres + Citus (distributed HTAP), Postgres + TimescaleDB (time-aggregations), or DuckDB as an analytics sidecar. MySQL HeatWave is genuinely fast but locks to OCI / AWS. For open-stack analytics, Postgres wins clearly.
Geospatial / GIS
Postgres + PostGISPostGIS is the industry standard. Every major open-source GIS tool (QGIS, GeoServer, OpenStreetMap, Mapbox tile-gen) works natively with PostGIS. MySQL spatial is adequate for simple point-in-polygon; PostGIS handles complex geometry, raster, topology, and coordinate projections.
Time-series
Postgres + TimescaleDBTimescaleDB (open-source core) builds on Postgres to handle trillions of rows, continuous aggregates, compression, and time-based partitioning automatically. MySQL alternatives for time-series are significantly less mature.
Sharded / massive-scale OLTP
MySQL via VitessVitess (MySQL) has a more battle-tested production track record for sharded OLTP than Citus (Postgres). YouTube created Vitess for its MySQL fleet. Slack, GitHub, and Booking.com all run Vitess at massive scale. Citus is younger but well-supported by Microsoft.
WordPress / Drupal / Magento (LAMP)
MySQL / MariaDBThe LAMP ecosystem is MySQL-native. WordPress on Postgres is documented pain: the WP community has tried it (WP-Postgres plugin) but MySQL is the first-class path. Magento is MySQL-only. Drupal technically supports Postgres but MySQL is the common deployment.
OLTP with complex joins, CTEs, windowing
PostgresPostgres's query planner is stronger for complex multi-table joins, CTE materialisation control (MATERIALIZED hint), and analytical-style queries on an OLTP dataset. For workloads that blend CRUD with reporting, Postgres wins.
Startup MVP / new project
PostgresDefault Postgres. Supabase, Neon, Railway, and Render make Postgres setup frictionless. You can add PostGIS, TimescaleDB, or Citus later without changing databases. You cannot add these to MySQL.
Framework-fit table
| Framework | Leans toward | Notes |
|---|---|---|
| Django | Postgres | Django docs explicitly recommend Postgres. django.contrib.postgres provides JSONB fields, ArrayField, HStoreField, full-text search support. MySQL is a supported backend but docs lean Postgres. |
| Rails | Either; Postgres slightly more idiomatic | ActiveRecord supports both well. Newer Rails features (jsonb, partitioning helpers) are Postgres-first. |
| Laravel | MySQL | Laravel's ORM (Eloquent), migration system, and docs are historically MySQL-tilted. The ecosystem assumption is MySQL. |
| Spring Boot (JPA) | Either | JPA abstraction means both work equally well. Choose based on team familiarity and DBA depth. |
| Node.js + Prisma | Either (Postgres marginally better tooling) | Prisma supports both. Postgres tooling is marginally richer (Neon, Supabase integration, JSONB native type). |
| FastAPI + SQLAlchemy | Postgres | Python ecosystem tilts Postgres. psycopg2/psycopg3 are the canonical adapters. SQLAlchemy's Postgres dialect is the most feature-complete. |
DB choice is part of a larger stack decision. See related: Rust vs Go · Monorepo vs Polyrepo · Tech Stack Cost