Vicedomini Softworks

Software Development

PostgreSQL vs MySQL: Which Database Should You Choose?

11 November 2026

Engineer comparing relational database schema diagrams

For most new business applications, PostgreSQL is the safer default: it offers stricter data integrity, richer SQL and a wider set of data types, and it keeps room for growth in analytics and complex queries. MySQL remains a sound choice for read-heavy web workloads, existing MySQL estates and teams whose tooling is already built around it. The difference in raw speed is far smaller than most articles imply, so the decision rests on workload shape, data model and operations.

Vicedomini Softworks
Choose a Database That Fits Your Product
Vicedomini Softworks helps businesses solve complex technical challenges through custom software engineering, from architecture through deployment and ongoing support.
Ask for a consultation

TL;DR

  • Choose PostgreSQL when data integrity, complex queries, JSON and extensions, or analytical reporting matter to the product.
  • Choose MySQL when the workload is simple and read-heavy, when you are extending an existing MySQL system, or when your team’s skills sit there.
  • Performance is comparable for most workloads. A missing index costs far more than the choice of engine.
  • Each engine has operational costs of its own: vacuum and connection handling on PostgreSQL, storage-engine and isolation behaviour on MySQL.
  • Migrating between them changes behaviour in ways that tests do not always catch, so decide early and design for the engine you pick.

Table of Contents

The short comparison

Both systems are mature, open source relational databases that speak SQL, and at a high level their feature sets are comparable, as Ubuntu’s own comparison also notes. The differences appear in how each handles transactions, concurrency, data types and extension.

Criterion PostgreSQL MySQL
Design Object-relational, extensible with custom types and functions Relational, popular for web applications
ACID Fully ACID-compliant in all configurations Depends on the storage engine
Concurrency MVCC without read-write locks Write locks in some cases, InnoDB uses MVCC with an undo log
Default isolation READ COMMITTED REPEATABLE READ
Indexing Many index types, including GIN and Hash Fewer index options
Materialized views Supported Not built in
Licence Permissive open source Community Edition under the GPL, paid commercial editions
Typical fit Complex queries, frequent writes, evolving data models Simple, read-heavy workloads, prototypes, existing MySQL stacks

The ACID, MVCC, materialized view and index points follow AWS’s comparison of the two engines, and the additional index detail follows IBM’s overview. Treat the table as a map of tendencies. Individual releases, storage engines and managed services shift the details, so confirm any feature that your design depends on in the current documentation.

What actually differs under the hood

Data integrity and transactions

PostgreSQL describes itself as ACID-compliant since 2001, and its official About page lists foreign keys, exclusion constraints, all SQL-standard isolation levels including Serializable, and point-in-time recovery among its core capabilities. MySQL with InnoDB is also transactional, but the guarantees depend on the storage engine in use, which is why architects who need uniform behaviour across a large estate tend to prefer the engine where that question does not arise.

Two behavioural differences matter in daily development. First, the defaults: MySQL uses REPEATABLE READ and PostgreSQL uses READ COMMITTED, so code ported between them can change meaning. A report that relied on a stable snapshot in MySQL may see a moving target in PostgreSQL, and a read-modify-write pattern that silently overwrote concurrent commits in MySQL can fail with a serialization error in PostgreSQL at repeatable read.

Second, error handling. In PostgreSQL, any error aborts the whole transaction and later statements are rejected until it ends. In MySQL a failed statement rolls back only itself and the transaction continues. Neither is wrong, but application code, ORMs and retry logic must be written with the right model in mind.

PostgreSQL and MySQL transaction behavior compared

Data types, indexing and extensibility

PostgreSQL’s central selling point is extensibility: custom types, functions and procedural languages are part of the design, according to its project documentation. In practice this means richer indexing (GIN for composite and document-style data, for example), materialized views, table partitioning and a large extension ecosystem. EDB’s comparison summarises the common view: PostgreSQL is valued for advanced data types, full-text search and complex queries, while MySQL is favoured for ease of use and speed in smaller and medium-sized applications.

For a product whose data model will change, for instance a SaaS platform that mixes relational records with semi-structured payloads, the extra expressiveness reduces the number of separate systems you later bolt on.

Connections and process model

PostgreSQL creates a process per connection. AWS puts the cost at roughly 10 MB of memory per connected user, whereas MySQL serves multiple users from a single process. This is manageable, and the standard remedy is a connection pooler such as PgBouncer, but it should be in the architecture from the start rather than discovered during a traffic spike. Application frameworks that open many short-lived connections, such as serverless functions, make this particularly relevant.

Performance: what the evidence supports

The loudest claim in this debate is that one engine is simply faster. The evidence is more nuanced.

Bytebase’s analysis concludes that performance is comparable for most workloads, with variation of at most about 30%, while a query that misses an index can degrade by 10x to 1000x on either engine. It adds that MySQL can hold an edge in extreme write-intensive workloads, because InnoDB keeps old row versions in the undo log rather than in the table heap, which reduces bloat and vacuum needs.

Benchmarks that favour PostgreSQL exist and are worth reading with their conditions attached:

  • An academic benchmark published in MDPI’s Future Internet reported that select operations over a million records ran in 0.6 to 0.8 ms on PostgreSQL against 9 to 12 ms on MySQL in the authors’ setup, with insert performance similar. Under complex simultaneous operations PostgreSQL’s select times stayed stable while MySQL’s degraded.
  • DoltHub’s sysbench latency tests found PostgreSQL roughly 2.3 times faster overall on their hardware configuration, with the gap driven by writes.

These results should be treated as evidence about the tested configurations, not as a verdict. As FPT Cloud’s benchmark documentation points out, throughput depends on workload, schema, indexing, read/write ratio and storage and network setup, so figures are reference data and not a guarantee. The practical conclusion for a project is that schema design, indexing and query review will move your results more than the engine label. A realistic load test with your own queries before production is standard engineering practice for either choice.

The costs of PostgreSQL that teams should plan for

An honest comparison names the engineering costs on both sides, because they shape how you run the system, not whether it is the right one.

Uber’s engineering team published a well-known account of leaving PostgreSQL for MySQL in 2016. Their main points were write amplification, because an update creates a new row version and touches every index, a verbose replication stream, replica behaviour under long-running queries, and the cost of process-per-connection. Carnegie Mellon’s Andy Pavlo later described the same append-only versioning scheme as the part of PostgreSQL he likes least, pointing at data duplication, extra index maintenance and contention.

The counterpoint matters equally. A PostgreSQL community response to Uber argued that Heap-Only Tuple optimisations mitigate write amplification for updates to non-indexed columns, that some of Uber’s autovacuum claims had not been true for years, and that MySQL carries its own costs: secondary index lookups need two index operations, and reconstructing old row state from the rollback area hurts concurrency.

The operational takeaway is concrete. On PostgreSQL, autovacuum must keep pace with write volume; one practitioner guide calls falling behind the biggest operational concern, and the one that most often surprises teams arriving from MySQL. Monitoring dead tuples, tuning autovacuum for hot tables and pooling connections turn these costs into routine maintenance. Workloads dominated by very high write rates on heavily indexed tables deserve capacity testing before the choice is final.

The costs of PostgreSQL that teams should plan for

Licensing and cost

PostgreSQL is free and open source, and enterprise support is available from vendors for a fee. MySQL Community Edition is also free, licensed under the GPL. The structural difference lies in the paid tiers: Oracle sells MySQL Standard and Enterprise subscriptions, and Bytebase lists them at $2,140 and $5,350 per server per year for one to four sockets, adding features such as audit, transparent data encryption key management and masking. Check Oracle’s current price list before budgeting, since these figures can change.

In managed cloud services the licence question largely disappears, because both engines are offered as hosted services and you pay for compute and storage. There the more relevant question is which engine your team can operate and tune best.

Who uses what

MySQL’s footprint is enormous, particularly in content-driven web hosting and the PHP ecosystem. PostgreSQL’s momentum is clear in recent platform decisions. Netflix’s Online Data Stores team standardised on Amazon Aurora PostgreSQL in 2024 after finding it supported over 95% of the applications and workloads running on other relational databases across its internal services. That is a statement about one organisation’s workloads, but it shows that PostgreSQL covers a very wide range of requirements.

So MySQL is still very much in use, and the question is rarely whether it works. It is whether it fits the system you are building next.

How to decide

When PostgreSQL is the stronger choice

AWS positions PostgreSQL as better suited to enterprise applications with frequent writes and complex queries. In practice it is the natural pick when you need strict constraints and integrity guarantees, reporting queries with joins and window functions, JSON or geospatial data next to relational tables, or a platform that will grow into analytics. Multi-tenant SaaS products, financial and operational systems, and integration-heavy back ends fall into this group.

When MySQL is the stronger choice

The same AWS guidance suggests MySQL for prototypes, internal applications with fewer users, and information stores with more reads than updates. Add to that the pragmatic case: an existing MySQL system with working operations, a CMS or framework that assumes it, or a team with deep MySQL experience. Rewriting a stable system to change engines rarely pays back on its own.

A decision sketch

A useful sequence runs as follows. Start from the data model: if integrity rules, rich types or complex reporting are central, lean PostgreSQL. Then look at the write profile: sustained, very high write rates on heavily indexed tables call for a load test on both engines. Then look at the team and the platform: managed services, existing tooling and hiring pool often settle close calls. Finally, consider the exit cost, since moving later means revisiting isolation levels, error handling, SQL dialect details and operational runbooks.

Our perspective

We design and build custom software, SaaS platforms and integrations, and the database decision appears in almost every architecture review we run. Our position is that the engine is rarely the part that makes or breaks a system. What decides the outcome is whether the schema, indexes, transaction boundaries and operational practices were chosen deliberately and written down.

For new products with evolving requirements, multi-tenant designs and integration-heavy platforms, we usually find PostgreSQL gives teams more room: stricter integrity, richer types and a strong extension ecosystem. For established MySQL estates, we focus on making them reliable, observable and maintainable instead of recommending a migration for its own sake.

Because our clients work directly with the engineers who design and maintain the software, the trade-offs above, such as isolation defaults, connection pooling and vacuum tuning, are discussed as concrete engineering decisions and delivered as written recommendations, not left implicit. We work without vendor bias, and that includes database vendors.

Pepe F.

Getting the decision right with an engineering partner

Choosing a database is one of the architecture decisions that is expensive to reverse. If you are selecting a stack, auditing an existing one or planning a migration, our team can help through architecture and technology stack consulting, code audits and custom software development, working directly with the engineers who will build and maintain the result.

Vicedomini Softworks

For teams that want ongoing senior technical direction, our CTO advisory subscriptions are published from €1,800 per month for CTO Advisory, from €4,000 per month for Fractional CTO and from €7,500 per month for CTO Partner, with an initial assessment from €3,500 one-off.

FAQ

Why is PostgreSQL often preferred over MySQL?

PostgreSQL offers full ACID compliance in all configurations, a broad set of index types and data types, and an extension model that lets the database grow with the product. Those traits suit applications with complex queries and frequent writes. For simple, read-heavy sites the advantage is smaller.

Does Netflix use Postgres?

Netflix’s Online Data Stores team standardised on Amazon Aurora PostgreSQL as its primary relational database in 2024, after finding it supported over 95% of the workloads running on other relational databases across its internal services. This describes Netflix’s internal services, not every system the company runs.

Does anyone use MySQL anymore?

Yes. MySQL remains widely deployed, especially in web hosting and content management, and Oracle continues to ship it as a free Community Edition and as paid commercial editions. It is a reasonable choice for read-heavy workloads and for teams with existing MySQL systems and expertise.

What are the disadvantages of PostgreSQL?

The main operational costs are write amplification from its row versioning, the need to keep autovacuum healthy on write-heavy tables, and memory use per connection, which a pooler such as PgBouncer addresses. These are well understood and manageable with monitoring and sensible configuration.

Can I migrate from MySQL to PostgreSQL later?

Yes, but plan for behaviour differences beyond syntax: default isolation levels, transaction error handling and SQL dialect details differ. Budget for testing the application against PostgreSQL semantics, not only for moving the data.

Sources

This article was produced with AI assistance and reviewed for accuracy. It is provided for general information only and is not professional advice.

Tell us about your project