HACKER Q&A
📣 unsolved73

Postgres vs. MySQL in 2023?


MySQL was bought by Oracle, and it's common knowledge that dealing with Oracle is looking for troubles.

And yet, I just tried PlanetScale[0] which uses MySQL under the hood and I'm mind blown. They completely nailed the user/developer experience! (I'm absolutely not affiliated with them by any way)

So, it's very tempting to go with them for a new project and thus go the MySQL way, but I still have nightmares of using MySQL almost a decade ago.

So I would love to hear the arguments of the community on why I should favor one database over the other.

[0] https://planetscale.com


  👤 stefanos82 Accepted Answer ✓
MariaDB [1] is a community developed fork of MySQL, so you can feel free to use that in place of MySQL.

Another alternative would be Percona [2] which is a drop-in replacement for Oracle MySQL.

About PostgreSQL I haven't had that much of personal experience with it, but for sure I plan to learn it, because it has been battle-tested for years with lots of well-known projects, such as Django framework, for instance.

[1] https://github.com/MariaDB/server

[2] https://github.com/percona/percona-server


👤 h2odragon
Chopping off limbs to gain separation from Oracle or affiliated entities would be quite reasonable, imo. avoid risking a connection in the first place is a great idea.

On the other hand, what is it you're planning to do with this tool? try it out for a day? use it for a single project? adopt it as the central feature of your life from now on and start arranging conferences and religious observances centered on it?

The assessment of risk should include how much value you're risking. Poke at it for one demo job to see if its useful may not be unreasonable either. "purity" doesn't demand utter ignorance of the sins available.


👤 jamil7
I think Neon is heading in the direction of Planetscale but for Postgres https://neon.tech

👤 fiedzia
Most project I see (and all I work with) use Postgres and I am very happy not to waste time on researching 50 ways in which using any 2 mysql features together will shoot you in the foot. There is huge amount of interesting projects bult on top of pg (like timescaledb or edgedb), every provider I know can host it so overall I'd say that using mysql would be a limitation at this point.

👤 ireallywantthat
Postgresql

👤 samlambert
MySQL is significantly better than when you last used it. We also add Vitess in the middle which adds incredible benefit. We run clusters at huge scale with solid reliability. A lot of the features you have enjoyed on the PlanetScale platform so far are there because of the power of MySQL + Vitess. I've seen some other vendors mentioned here but unless they have Vitess they have nothing close in terms of power.

If you have feedback or want to learn more about PlanetScale feel free to email me s@planetscale.com


👤 mannyv
Really, mysql is much less work.

I haven't used psql in a while, but there are lots of little things with psql that are aggravating...like case sensitivity/insensitivity and the fact that you need to actually manage it. The whole idea of vacuuming irritates me.


👤 runjake
Pick one and stop debating between two good options?

👤 karmakaze
If you're willing to spend time making good indexes and using index hints as needed, you can get better performance/cost with MySQL. Note that PostgreSQL has advanced features not available with MySQL. BTW, you don't have to deal with Oracle with MySQL/MariaDB unless you want support from them.

One thing I'd really like to use is the MyRocks (RocksDB LSM-Tree) storage engine (instead of InnoDB) for MySQL. I don't know what the production usage status of this is, but it seems to be taking a long time getting adoption. I'd used TokuDB with Percona MySQL 5.7 and it was fantastic for high-write workloads.

I would choose PostgreSQL if operating cost doesn't matter much. Developer experience is much better. Less time spent on making queries run the way you mean them to.

I also have good experiences with MySQL replication and multi-writer configurations. This might be better now with PostgreSQL but it wasn't when I looked a long while ago.

What I'd probably rather use is Google Cloud Spanner or CockroachDB though, over either MySQL or PostgreSQL. The way you build queries is different--these work better with larger queries, not rapid small ones. So it's best to start with them than try to convert a working normal SQL system to a distributed one. If you really want to go SQL -> CockroachDB then PostgreSQL is probably better since CrDB supports (a subset of) the protocol (but is explicitly not compatible in terms of supported query features). Just googled it and it now says:

> CockroachDB supports the PostgreSQL wire protocol and the majority of PostgreSQL syntax.