Why MySQL won... and is now losing

When I first started working with database-powered websites in 1998, MySQL was a choice made for me by the person I was working with. For 26 years, it was my first choice when it came to choosing a database server for a project (or a variant like MariaDB).

PostgreSQL might be more "correct" in terms of the SQL spec, it might even be more performant, but it's developers have clearly missed something very simple over the past two decades when trying to appeal to new or MySQL users.

It's UX is horrible. Especially for beginners.

I'm a command line SQL user, exclusively using the MySQL client. I've tried desktop GUIs, alternative clients - but none of them have been any better.

Commands in MySQL are easy to remember, because they're mostly English words:

describe foo; or even just desc foo

show tables

show databases

And then the client does a great job of formatting things. Nice ASCII tables. ; for a single line, \g for multiline. Easy process management, show processlist.

PostgreSQL on the other hand has horrible commands:

\d foo

\dt

\l

The formatting is sub-par, with everything bunched together, and it's less obvious how to change that with each command.

Are these true SQL spec commands? Sure. Do your new users care? Of course not.

But if I'm trying new software, or getting into this kind of development for the first time, I don't care about any of that. I just want it to be simple, and easy to remember.

I think PostgreSQL could have been far ahead of MySQL years ago if they'd just embraced simple MySQL style commands. Add support for "show tables" for all the people converting over. Improve the client output.

It sounds stupid, but newbies will absolutely favour "show tables" over "\dt".

I always got the impression that PostgreSQL users thought they were better and that they didn't need to bow down to the whims of database users who didn't even know what SQL:1999 was.

So why is a MySQL variant no longer my first choice? Because PostgreSQL does schema updates in a transaction, and MySQL does not. With managed migrations, automated CI and devops processes, it's very easy to get yourself in a mess with MySQL when the migration only half works. I assume this, along with various other methods for managing multiple schemas and managing migrations, is why more projects are choosing PostgreSQL over MySQL variants.

Again, something so simple missing from MySQL is enough to tip the balance in the other direction. Something that 20 years ago, DBAs were likely doing by hand, rather than by automated scripts.

It doesn't take much to make users switch. It often just takes a while.

Oh, and I use it with a GUI.