PostgreSQL vs MySQL, a comparison
A quick comparison between PostgreSQL and MySQL
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.
THE VALLEY OF CODE
THE WEB DEVELOPER's MANUAL
You might be interested in those things I do:
- Learn to code in THE VALLEY OF CODE, your your web development manual
- Find a ton of Web Development projects to learn modern tech stacks in practice in THE VALLEY OF CODE PRO
- I wrote 16 books for beginner software developers, DOWNLOAD THEM NOW
- Every year I organize a hands-on cohort course coding BOOTCAMP to teach you how to build a complex, modern Web Application in practice (next edition February-March-April-May 2024)
- Learn how to start a solopreneur business on the Internet with SOLO LAB (next edition in 2024)
- Find me on X