Live data from Hacker News

Ask HN: It's 2023, how do you choose between MySQL and Postgres?

news.ycombinator.com

151–160 of 366 posts

Re: Ask HN: It's 2023, how do you choose between MySQL and Postgres?

#151
postgres just because I'm more familiar with it, and the extension ecosystem (TimescaleDB, PostGIS, etc etc).

That said, I'm not going to be sad with MySQL, though I'd probably go with MariaDB just because of full open source (note, I don't know any details there, being a postgres guy)

Re: Ask HN: It's 2023, how do you choose between MySQL and Postgres?

#152
post #36

There is almost no good reason to choose MySQL over PostgreSQL for any operational reason, I did a deep dive many moons ago (before major improvements in performance to postgres) and people were saying that MySQL was faster. I found that not to be true and the differences have only gained even more favour towards postgres. also, I assume you mean MariaDB as MySQL is owned by Oracle and I would greatly implore anyone…

Postgres is >50x slower for range queries(example below) and is akin to using array-of-pointers (ie Java) whereas MySQL supports array-of-struct (C). Illustration from Dropbox scaling talk below. Sneak peek photo [1] (from [2]). Just imagine its literally 500-1000x more convoluted per B-tree leaf node. That's every Postgres table unless you CLUSTER periodically. [1]: https://josipmisko.com/img/clustered-vs-noncluster…

Thanks for that informative link. It's rare in these sorts of discussions.

Re: Ask HN: It's 2023, how do you choose between MySQL and Postgres?

#154
post #36

There is almost no good reason to choose MySQL over PostgreSQL for any operational reason, I did a deep dive many moons ago (before major improvements in performance to postgres) and people were saying that MySQL was faster. I found that not to be true and the differences have only gained even more favour towards postgres. also, I assume you mean MariaDB as MySQL is owned by Oracle and I would greatly implore anyone…

> avoid Oracle as if it has herpes herpes isn't that bad. most people will get it in their lifetime. 1 in 6 people have hsv-2, the less common variant. trying to avoid herpes is like trying to avoid chickenpox (although herpes isn't nearly as harmful as chickenpox). you should avoid Oracle like it's a blood pathogen.

Chickenpox is actually caused by a herpesvirus. herpes varicella zoster.

Re: Ask HN: It's 2023, how do you choose between MySQL and Postgres?

#155
post #122

Earlier quoted context omitted.

I'm primarily a software engineer, not a member of "large support teams". I've also worked for many years as an independent consultant, brought in when things go wrong, certainly not when they were first "installed". I'm not "afraid" of anything concerning my knowledge going "out the window". If MySQL suddenly disappeared worldwide, I could happily pivot to some other area of software engineering, or I could simply r…

1. The log-replication method of upgrading can be performed using the built-in logical replication facilities as well as using external logical replication systems such as pglogical, Slony, Londiste, and Bucardo. Most of which have existed essentially forever. 2. Failovers of any database are not instant, but they are indeed quick! So let’s not claim that you can do an upgrade with zero downtime. 3. In-place upgrades…

While you two have agreed on approximately nothing, this has been an informative discussion and I do thank you both.

Re: Ask HN: It's 2023, how do you choose between MySQL and Postgres?

#156
post #143

I know it seems dumb, but postgres really needs to add the simple developer experience stuff like: SHOW CREATE TABLE; SHOW TABLES; SHOW DATABASES; SHOW PROCESSLIST; CockroachDB added these aliases ages ago.

This. For anything at home, I would use MySQL just for those things. The psql client feels very primitive by comparison to me - even though it isn't.

I highly suggest investing time learning psql, autocomplete works great and it has a ton of useful slash commands. \d for instance shows you the list of tables. Awesome tool

Re: Ask HN: It's 2023, how do you choose between MySQL and Postgres?

#157

Earlier quoted context omitted.

Having used postgres for the past decade, I tried MySQL for a side project to see whats changed with it. The sad answer is that it feels like nothing has changed - Oracle seems to have let what used to be a core technology of the industry languish. I'm sure there are use cases where MySQL will be the better choice over postgres, but the future for the stack looks bleak.

Creating a series of connections very quickly is cheaper in MySQL and MariaDB than in PostgreSQL. Typically, a connection poller is used before PostgreSQL to support connection scalability. I'm not sure if there has been a recent breakthrough that has changed that. I think that still applies today. Correct me if I'm wrong.

You can create a series of connections in postgres just as fast. The connection pooler you are referring to is when you put pgBounce or pgPool in between your pgdb and your client software to expand beyond the physical limits of connections and optimize clustered architectures. MySQL at scale is replication only. A few commercial offerings for MySQL like planetscale have brought MySQL into the 21st century. Postgres has a couple ways of clustering, sharding, scaling, beyond your Wordpress database.

Re: Ask HN: It's 2023, how do you choose between MySQL and Postgres?

#158
post #16

Earlier quoted context omitted.

Ok, here's one: When you give MySQL invalid data, its standard behavior is to just silently store garbage in your database in many cases where PostgreSQL would've told you that your data is invalid. MySQL's handling of unicode has also been terrible historically, with way too many foot guns, but I don't know if that may be better with recent versions. People aren't providing strong reasons because the question wasn't…

> When you give MySQL invalid data, its standard behavior is to just silently store garbage This is a common misconception, but this hasn't been the case for over 7 years. MySQL 5.7, released in Oct 2015, changed its defaults to enable strict sql_mode. All prior versions have hit end-of-life for support years ago, so there is no modern version of MySQL with this silent truncation behavior. The only reason this proble…

> But please, let's compare 2023 Postgres with 2023 MySQL, not 2023 Postgres with much older MySQL. It's only fair.

Heh Heh Heh

On a humorous note, the official MySQL page (in the early 2000's) comparing MySQL vs other databases had the same problem.

They'd list the latest and greatest MySQL version, but compare it against archaic versions of the others. Clearly on purpose, because "Marketing" probably.

Asked them (via official @postgresql.org email address) to please update that page to more a recent PostgreSQL, for fairness. And was completely ignored of course.

So it's kind of amusing to see a request for fairness in the opposite direction (which I agree with anyway) ~20 years later. ;)

Re: Ask HN: It's 2023, how do you choose between MySQL and Postgres?

#159
post #64

If you are using .NET then Postgres might be better choice. (much better support for drivers and default ORM). If you need replication go with MySQL.

https://mysqlconnector.net/ is very good.

Dapper and ^ that works very well IME.

Agreed about replication.

Re: Ask HN: It's 2023, how do you choose between MySQL and Postgres?

#160
post #143

I know it seems dumb, but postgres really needs to add the simple developer experience stuff like: SHOW CREATE TABLE; SHOW TABLES; SHOW DATABASES; SHOW PROCESSLIST; CockroachDB added these aliases ages ago.

I forget if there's an equivalent for the first one, but from psql there is a translation of mysql's "DESC table" as "\d table", and the rest are:

\dt

\l

SELECT * FROM pg_stat_activity;

Post reply on HN