New Laravel project: docs support both. Shared host only offers MariaDB. Lead dev prefers Postgres for JSONB and constraints. Sales cites "MySQL is faster" without benchmark.
For a modern web app, comparison plays out on data model and hosting ecosystem — not slogans.
Strengths by web usage
| Usage | MySQL/MariaDB | PostgreSQL |
|---|---|---|
| Classic WordPress / Drupal | Native | Non-standard |
| Greenfield Laravel / Django | OK | Often preferred |
| Semi-structured JSON | JSON type | Indexed JSONB |
| Geospatial | Limited | PostGIS |
| Advanced SQL reporting | Correct | Strong CTE, windows |
| Entry hosting | Ubiquitous | Less frequent |
MySQL serves historical web CMS well. Postgres serves application products with database logic well.
Technical criteria that decide
Choose MySQL/MariaDB if: imposed stack (WordPress, default PrestaShop), shared without Postgres, existing MySQL DBA team.
Choose PostgreSQL if: strict integrity constraints, JSONB, integrated full-text, SQL analytics, extensions (pgvector, PostGIS).
Hosting and operations
Shared: MariaDB included — no Postgres → MySQL implicit.
VPS: install both; separate DB and app.
Managed: RDS/Aurora MySQL vs RDS/Scaleway Postgres — compare point-in-time backup and identical storage pricing.
Mid-life MySQL → Postgres migration is expensive — decide early on greenfield.
The climax: the database that best serves your app is the one you host correctly
Align engine choice and hosting choice in same workshop.
Decide and move forward without blind spots
First list imposed CMS/framework and required DB extensions. Check host offer: Postgres available? which version? Prototype critical queries on both if unsure. Compare database hosts via directory and comparator.
Frequently asked questions
Should WordPress stay on MySQL?
Official WordPress targets MySQL/MariaDB — Postgres possible via non-standard plugins. For pure WordPress, MySQL/MariaDB remains rational choice.
Is PostgreSQL more "strict"?
Yes — types, foreign key constraints, and transactions often more rigorous. Useful for complex models; requires cleaner migrations.
MySQL 8 vs PostgreSQL 16 for new SaaS?
Postgres for JSONB, recursive CTEs, analytics windows, PostGIS. MySQL for legacy MySQL team, cheap shared hosting, or imposed LAMP stack.
Hosting impact?
Shared = MySQL/MariaDB almost always. VPS/cloud = both; managed Postgres common for modern SaaS.
MySQL or PostgreSQL: the database that best serves your web app is the one your stack and host support without contortion.
