DEV Community

Discussion on: PostgreSQL or MySQL: What Should I Choose for My Full-Stack Project?

Collapse
 
syndesi profile image
Syndesi

MariaDB is the default replacement for MySQL on most Linux distributions these days :)

Collapse
 
leandro_nnz profile image
Leandro Nuñez

According to statista, the next linux alternative to MySQL is PostgreSQL
statista.com/statistics/809750/wor...

Also of 2024:
geeksforgeeks.org/most-popular-dat...

But MariaDB would be a great alternative. I will cover that in another article! Thanks for your comment.

Collapse
 
ttfkam profile image
Miles

MySQL and MariaDB are diverging enough to be considered different engines with different feature sets.

For example use MariaDB if you want/need temporal tables, exclusion constraints, a native UUID type, user-defined functions as a column default, support for sequences, or reference a temporary table twice within a single statement.

Use MySQL if you want/need CTEs in a subquery, descending indexes, expression indexes, the ability to reliably use it as a queue, or use LATERAL joins.

Neither is a strict superset or subset. Then again, if you're looking for the engine supporting the most features, you need to look closer at Postgres. The only thing really missing there from either MariaDB or MySQL is temporary tables (which you can work around with community-supported options).

Collapse
 
leandro_nnz profile image
Leandro Nuñez

Then, I don't get the first comment. Why MariaDB would be the alternative to MySQL if it's considered a complete different engine?
The idea of the article is to set the differences on the most-feature-sharing engines used and what to check before choosing. It has no relation on which one is the better. Thanks for your comment!

Thread Thread
 
ttfkam profile image
Miles

MariaDB forked from MySQL years ago. They are wire-compatible with one another, so a MySQL client can connect to a MariaDB server and a MariaDB client can connect to a MySQL server. You can use admin tools like MySQLWorkbench and phpmyadmin with both as well.

So unless you're using a feature that doesn't exist in the other one, you can swap between them relatively easily.

The same is true for products like Yugabyte, CockroachDB, and Postgres; they are all wire-compatible with one another. Easily swap out as long as you're not using an engine-specific feature even though they have very different performance envelopes.

Thread Thread
 
leandro_nnz profile image
Leandro Nuñez

Still don't see the point of the comment.
This article is specific to MySQL and PostgreSQL. I'm really sorry if not adding MariaDB as an option made you fell unconfortable or similar. That was not my intention at all.
I was trying to showcase the two closest engines.
Perhaps, you want me to cover MySQL or MariaDB in another article.
Just let me know.
Thanks for your comment.