In this post I want to make a high-level comparison of PostgreSQL and MySQL.
One of the main selling points of PostgreSQL is the license. PostgreSQL is Open Source, has the GPL license, and it is owned by the PostgreSQL Global Development Group community.
MySQL today is owned by Oracle, and has 2 difference licenses. One is open source, the other one is commercial. This does not mean that if you want to use MySQL for a commercial project you need to pay. The commercial license provides paid support and additional software built on top of MySQL, from Oracle.
There is a fully Open Source fork of MySQL called MariaDB, which is much less popular in terms of usage and branding, because it does not have the same history of MySQL, but it’s an optimal drop-in replacement if you prefer MySQL but you are worried about licensing.
Let’s talk about features.
More or less, the feature set of both MySQL and PostgreSQL is equivalent. One might do something that the other does not, but we’re talking about very advanced features that I’m not getting into here.
Both are very advanced database management systems that have a long history.
Both support the SQL standard (not completely, but a large portion) and add features on top of it. Both provide ACID (Atomicity, Consistency, Isolation, Durability) compliance.
Both allow to easily create replication, both are very secure, both have a huge community around them for any problem you might have.
Both have a large set of tooling built around them.
Which one should you choose? It’s hard to say.
Unless you need one particular feature implemented in one and not implemented in the other, I would choose the one you are already familiar with.
For example, if you come from WordPress and have interacted with MySQL before, you can just stick to it (or MariaDB).
It might also depend on the platform you want to deploy your software on. Heroku for example provides a built-in managed PostgreSQL cloud database as a service, which might be very convenient instead of managing your own database server.
Want to become a better Web Developer? Join the 2022 Web Development Bootcamp!