Signup to the waiting list!
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.
More database tutorials:
- The MongoDB basics tutorial
- How MongoDB is different from a SQL database
- Information systems, data and information
- Data models
- Introduction to the ER Data Model
- The Relational Model
- Relational Algebra
- Relational Databases
- What is a Database? And a DBMS?
- Introduction to SQL
- How to install PostgreSQL on macOS
- Do you always need a database for your app?
- How to install SQLite on macOS
- Introduction to PostgreSQL
- PostgreSQL User Permissions
- How to list all users in PostgreSQL
- How to switch database using PostgreSQL
- How to list all databases using PostgreSQL
- How to list tables in the current database using PostgreSQL
- How to install MySQL on macOS
- Creating a user on MySQL
- PostgreSQL vs MySQL, a comparison
- SQLite User Permissions
- MySQL User Permissions
- SQL, creating a table
- SQL, adding data to a table
- SQL, how to use SELECT
- SQL, Handling empty cells
- SQL, Unique and Primary keys
- SQL, how to update data
- SQL, how to update a table structure
- SQL, how to delete data and tables
- SQL Joins
- SQL Views
- How to insert multiple items at once in a MongoDB collection
- How to remove all items from a MongoDB collection