MySQL and PostgreSQL are the two RDBMS candidates most teams actually choose between: mature, free and able to run almost any project you point them at. The interesting question is not which wins but which fits your workload, because they optimise for different things: MySQL for fast reads at scale, PostgreSQL for correctness, concurrency and extensibility. This comparison covers architecture, performance, replication, licensing and migration, on bare metal from $11.10/month.
Key Takeaways
- MySQL uses a pluggable storage engine, InnoDB by default. PostgreSQL has one integrated engine with MVCC throughout.
- PostgreSQL handles concurrent write pressure better. MySQL is often quicker on simple, read-dominated queries.
- Both have solid JSON support. PostgreSQL's JSONB is indexable and richer; MySQL's handling is lighter.
- Licensing is the sharpest difference: PostgreSQL is permissive and community-owned, MySQL is GPL and owned by Oracle.
- For most new projects PostgreSQL is the stronger default. MySQL remains the pragmatic choice on a read-heavy stack that already runs it, so the decision depends on what you have.
What Is MySQL? Core Architecture and Use Cases
MySQL arrived in 1995 and became the database behind the LAMP stack, WordPress and a large share of the web. Oracle acquired it in 2010.
Its defining design is the pluggable storage engine. InnoDB is the default and provides ACID transactions, row-level locking and foreign keys; other engines exist for specialised needs. That separation between the SQL layer and the storage layer is unusual, and it is why MySQL performance can be tuned so aggressively for one access pattern. Each engine offers a different set of guarantees.
MySQL suits read-dominated production applications: content sites, catalogues, session stores, anything where the query set is known and the structure is stable. MySQL offers replication that is easy to set up and well understood, which is why it spread through shared hosting.
MariaDB, the community fork created after the Oracle acquisition, stays drop-in compatible for most workloads and is worth knowing about when licensing matters.
What Is PostgreSQL? Features and Community
PostgreSQL grew out of academic research at Berkeley and has shipped annually every September for decades. PostgreSQL 18 shipped in September 2025 with an asynchronous I/O subsystem that lifts read performance, skip scan on multicolumn B-tree indexes, and a uuidv7() function.
There is no company behind it. PostgreSQL belongs to its global community under a permissive licence, which is structural rather than cosmetic: no vendor can change the terms.
PostgreSQL offers depth that MySQL does not attempt, and each release enables more of it. Custom data types, custom operators, custom index types, table inheritance, window functions, common table expressions and a mature extension model. PostGIS for spatial data and pgvector for embeddings plug in as modules, not forks, and that is the pattern: the database grows rather than being replaced.
Key Architectural Differences Between MySQL and PostgreSQL
| Aspect | MySQL | PostgreSQL |
|---|---|---|
| Storage | Pluggable engines, InnoDB default | One integrated engine |
| Concurrency | Row locking plus MVCC in InnoDB | MVCC throughout |
| Type system | Permissive, more implicit conversion | Strict, rejects ambiguity |
| Extensibility | Plugins and engines | Modules, custom types, custom operators |
| Licence | GPL, dual commercial, Oracle | Permissive, community-owned |
| Replication | Binlog, easy to configure | Streaming plus logical replication |
Strict typing. PostgreSQL rejects data that does not match the column type. MySQL has historically been more forgiving, which is convenient until it silently truncates something. Strict mode closes most of that gap on current versions.
Process model. PostgreSQL forks a process per connection, so a connection pooler such as PgBouncer becomes necessary earlier than people expect. MySQL uses threads and holds many idle connections more cheaply.
Performance Benchmarks: Read/Write Speed and Query Optimization
Published benchmarks for these two are run on hardware you do not have, with a query mix that is not yours. Treat the shape, not the numbers, and measure your own workload before you decide anything on speed alone.
Read speed. On flat indexed lookups with a high read ratio, MySQL is frequently the fast option. The query path is shorter and the optimiser has less to consider. This is the workload MySQL was tuned for, and raw read speed is where it still shows.
Concurrent write throughput. PostgreSQL pulls ahead as concurrent write pressure rises. Its MVCC design means readers never block writers and writers never block readers, so write speed degrades more gracefully in production under mixed load.
Complex queries. PostgreSQL's planner is the more sophisticated of the two. On queries with several joins, aggregates or window functions it will usually find a better plan, and the performance gap grows with query depth. MySQL's optimiser has improved but remains simpler.
Indexing. MySQL offers B-tree and hash indexing plus full-text search. PostgreSQL adds GIN, GiST, BRIN and partial and expression indexes, which matters when the dataset stops being a simple tree of rows.
Storage dominates both. Database performance is I/O-bound before it is anything else, and NVMe changes more than engine choice does. Our guide to storage options for bare metal covers the difference.
Scalability and Concurrency: Horizontal vs. Vertical Scaling
Both grow vertically well, and a single machine goes further than most teams assume. The difference appears in how they scale out.
MySQL grows horizontally through read replicas and, historically, through sharding at the application layer. Group Replication and InnoDB Cluster give native high availability. Its lightweight connection handling makes a large read fleet straightforward to operate.
PostgreSQL scales out through streaming replicas and the logical path. Because each connection is a process, a pooler is part of any production deployment, and that is a scalability constraint you should plan for. Add-ons such as Citus bring distributed sharding when one node stops being enough.
The practical rule: if your growth is read volume, MySQL's replica model is the simpler option. If your growth is write concurrency or query complexity, PostgreSQL holds up better on one large machine, which is often the cheaper answer anyway.
Data Types, JSON Support, and Advanced Extensions
Data types. MySQL covers the standard set. PostgreSQL adds arrays, ranges, network address types, full-text search vectors, and the ability to define your own.
JSON. Both store it. MySQL validates and writes a binary format with a solid function set. PostgreSQL has json and jsonb, where JSONB is binary, indexable with GIN, and supports containment operators. For anything beyond occasional document handling, PostgreSQL is the stronger option.
Extension model. This is where the gap is widest. PostGIS makes PostgreSQL a serious spatial platform, pgvector makes it a vector store for analytics and retrieval work, and TimescaleDB turns it into a time-series database. None of these require a fork.
Replication, High Availability, and Disaster Recovery
MySQL uses binlog-based replication, genuinely easy to configure. Asynchronous by default, semi-synchronous available, and Group Replication enables automatic failover. Point-in-time recovery works through binlogs.
PostgreSQL offers physical streaming for a byte-identical standby and logical replication for selective, cross-version copying. That logical path is also what makes major-version upgrades less disruptive. Continuous archiving enables point-in-time recovery, and tools such as Patroni or repmgr handle automatic failover. Test a restore regularly to ensure the archive is usable in production.
Neither is a backup. A standby copies your mistakes as faithfully as your data, so the availability story and the recovery story are separate problems that both need solving.
💡 Tip Run the database on its own machine once it matters. Sharing a box with the application layer means they compete for the same page cache. Our dedicated database server page covers the sizing.
Licensing, Total Cost of Ownership, and Vendor Support
This is the clearest difference between them, and it is not technical.
PostgreSQL uses a permissive licence close to BSD. You can embed it, modify it and redistribute it commercially with no obligation, which enables product deployment models MySQL makes awkward. No single company controls the project.
MySQL is dual-licensed: GPLv2 for open use, and a paid licence from Oracle when GPL terms do not suit your distribution model. For a server-side application neither matters much. For a product you ship to customers, it matters a lot.
Support. Oracle sells MySQL Enterprise. PostgreSQL has a competitive market of commercial vendors including EDB, Percona and Crunchy Data, so support is available without being tied to any owner.
Cost in practice. Both are free to run, so this does not depend on price. The real cost is engineer time plus the machine, and the machine is the smaller number. Our comparison of dedicated hosting vs VPS covers where that sits.
Ecosystem, Tooling, and Integration with Modern Data Stacks
MySQL has enormous reach: every shared host, every ORM, MySQL Workbench, phpMyAdmin, and every CMS you can name. If your stack is WordPress or a PHP application, MySQL integration is the default path and everything assumes it.
PostgreSQL has become the default in modern data work. Analytics pipelines, dbt, Airflow, Debezium change-data-capture and most managed cloud offerings treat PostgreSQL as the primary target. Its foreign data wrapper support lets it query external systems in place.
For a data pipeline feeding analytics, PostgreSQL's ecosystem is now clearly ahead. For a traditional web application, MySQL's reach is still unmatched.
Migration Paths: Moving From MySQL to PostgreSQL and Vice-versa
Most migration traffic runs one way. Moving to PostgreSQL is common; moving back is rare.
Schema. pgloader does most of the conversion automatically, including type mapping. Review the result rather than trusting it.
Syntax. The syntax gaps bite in specific places: AUTO_INCREMENT becomes GENERATED AS IDENTITY, backticks become double quotes, LIMIT x, y becomes LIMIT y OFFSET x, and MySQL's permissive GROUP BY will fail under PostgreSQL's stricter rules.
Stored procedures. Any stored procedure or trigger is a manual rewrite. There is no automatic path between the two procedural languages.
Application code. ORMs absorb most of it. Raw SQL and any code that relies on MySQL's implicit type conversion will need attention, and that is usually where the migration effort concentrates.
Run both in parallel during the transition, compare results on real queries, and cut over per table rather than in one step. Ensure every stored function behaves identically before you switch traffic.
Choosing the Right Database for Specific Workloads
Content and commerce. WordPress, Magento and most CMS platforms assume MySQL. Fighting that is not worth it.
Analytics and reporting. PostgreSQL, for the planner, the window functions and the ecosystem around it.
Geospatial. PostgreSQL with PostGIS. There is no real competition here.
Game backends and realtime services. Either works; what matters more is latency to the machine and consistent I/O. See our high-performance gaming servers page for that side.
Multi-tenant SaaS. PostgreSQL, for schema-per-tenant isolation and row-level security, which let one deployment serve many customers safely.
Read-heavy API with a flat schema. MySQL, for the shorter query path and the easier replica setup.
If your workload fits neither engine, such as a document store or a graph, our wider database server comparison covers MongoDB, MariaDB and Neo4j.
Verdict: MySQL or PostgreSQL for Your 2026 Project?
Choose PostgreSQL if you are starting fresh, if data correctness matters, if your queries are complex, if you need documents as a first-class type, or if licensing has to stay permissive. For most new projects that choice is the right default.
Choose MySQL if your stack already assumes it, if your workload is read-dominated with a simple schema, or if your team knows it well. The answer depends more on your situation than on either engine, and a team that can manage a database well beats a marginally better one nobody knows. On a dedicated server, our MySQL setup guide takes you from install to a hardened, tuned instance.
Either way, run it on hardware you control. Performance here is dominated by I/O and memory, and a managed instance charges a multiple for the same resources. Our bare metal use cases and dedicated hosting pages cover the options.
Frequently Asked Questions
Which is better, Postgres or MySQL?
Neither, in the abstract. PostgreSQL is better for complex queries, concurrent write pressure, data integrity and extensibility. MySQL is better for read-heavy workloads with a flat schema, ease of replication and ecosystem reach in traditional web hosting. The right choice depends on your workload, not on a ranking.
Does anyone still use MySQL?
Enormously. MySQL and MariaDB power a large share of the web, including most WordPress installations. It remains among the most widely deployed databases in the world. PostgreSQL growing faster does not mean MySQL is shrinking.
Does NASA use PostgreSQL?
Yes, in documented projects. NASA's Cumulus platform for Earth observation data uses PostgreSQL, the AMMOS Multi-Mission Geographic Information System requires PostgreSQL with PostGIS, and a 2024 Ground System Architectures Workshop presentation described PostgreSQL with TimescaleDB for satellite telemetry storage. It is a reasonable signal about reliability at scale, not a reason to choose it by itself.
Why is everyone using PostgreSQL?
Three reasons. The licence is permissive and no vendor controls it. The module system let it absorb spatial, vector and time-series work that used to require separate deployment of another database. And the annual release cadence has delivered steady, visible improvement. The result is that PostgreSQL has become the safe default rather than the specialist option.
How do licensing models differ between MySQL and PostgreSQL?
PostgreSQL uses a permissive BSD-style licence with no commercial tier and no owner. MySQL is GPLv2, with a commercial licence sold by Oracle for cases where GPL obligations do not fit. Running either on your own machine costs nothing; the difference appears when you redistribute software that embeds the database.
What are the main migration challenges from MySQL to PostgreSQL?
Stored procedures and triggers, which need a manual rewrite. Syntax differences in GROUP BY, identifier quoting and LIMIT. Implicit type conversions that MySQL allowed and PostgreSQL rejects. Schema conversion itself is largely automated by pgloader; the application code is where the work is.
Can I run both MySQL and PostgreSQL on the same Kimsufi server?
Yes. They use different default ports, 3306 and 5432, and do not conflict. On a dedicated machine with enough RAM this is common during a migration, and normal operation is unaffected: each runs as a separate service, so a routine operation on one never touches the other. Give each an explicit memory budget so they do not compete for the page cache, and keep their configuration files separate.
Which database offers better JSON handling for modern applications?
PostgreSQL, through JSONB. It stores documents in a binary form, indexes them with GIN, and supports containment and path operators, so those columns behave like queryable data rather than stored text. MySQL's JSON type is capable and enough for occasional use, but PostgreSQL is the one to choose when JSON sits at the centre of the schema.
Run your database on bare metal Kimsufi dedicated servers from $11.10/month. Root access, unmetered bandwidth, built-in DDoS protection.

