Live data from Hacker News

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

news.ycombinator.com

161–170 of 366 posts

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

#161

Earlier quoted context omitted.

hello, fellow person with herpes! (I assume) The worst part about having it is having to talk about having it. It's really not bad as a condition separate from societal concern.

I find similar societal concern when I tell friends I use Oracle.

Having Oracle experience on the resume is a positive, I suppose, but I'm not sure it's been worth the exposure.

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

#164
post #32

Earlier quoted context omitted.

Can you give a specific example of what you are missing when using SQLite?

At a certain scale, you'll want replication or replication, which SQLite doesn't really do AFAIK. At a scale below that, you'll probably want to be able to have multiple web servers talking to one database server, which SQLite doesn't really do either. I also think SQLite's performance during heavy write workloads is worse than PostgreSQL's? Basically, AFAIK, SQLite becomes problematic once you need more than one com…

Just to point out, there are now SQLite replication and various "distributed database" projects which seem to work fairly well.

They're probably not as battle tested as the PostgreSQL ones, but they are around, have users, and are actively developed.

The ones I remember off the top of my head:

* https://litestream.io

* https://github.com/rqlite/rqlite * https://github.com/canonical/dqlite

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

#165
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…

You are confusing two concepts here. In InnoDB, the tables are always ordered by the primary key when written to actual disk storage.

This is not the same as "having a primary key", Postgres also has primary keys. It just stores the PK index separately from the bulk of the data.

Oracle also has primary keys, even if the order of the rows is different to the key order. In Oracle, when the rows are stored in the same order as the keys in the primary index, it is a special case and these tables are called IOT, index ordered tables.

The disadvantages of IOT are that inserts are slower, because in a normal table, the data is appended to the table, which is the fastest way to add data, and only the index needs to be reordered. In an IOT, the entire table storage is reordered to take the new data into account.

Select queries, OTOH, are much faster when using IOT, for obvious reasons, and this is what you describe in your comment.

If you use TEXT, BLOB, or JSON fields, even in MySQL, the actual data is stored separately.

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

#166
post #83

Postgres. Fast, full-featured, rock-solid, and a great community. I think many of us can’t be bothered to go over (again) the issues we’ve had with MySQL in the past. The last straw for me was about ten years ago, when I caught MySQL merrily making up nonsense results for a query I’d issued that accidentally didn’t make any sense. Very likely this particular issue, and others like it, have been fixed in the meantime.…

Yep. The real question here is: it's 2023, why would you choose MySQL over PostgreSQL?

Not that there aren't reasons. There are some. But for starting out with a new app without a very, very good reason to do something different? PostgreSQL every day of the week.

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

#167
post #109

Unpopular opinion on HN apparently, but MySQL - It's less featureful, and I'd consider that a strong virtue in the YAGNI camp - less to go wrong, less mental overhead. - Maintenance is simpler and far less necessary in my general experience. - Replication is simpler and more reliable. - You can tell the query optimizer what to do. When this is needed, you'll be thankful. It's a godsend. That said, I wouldn't run Orac…

I would disagree on maintenance being simpler. I have never had Postgres randomly munge a table and require me to run a command to fix it.

[deleted]

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

#168
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…

MySQL is free, regardless of Oracle's ownership.

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

#169
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.

> most people will get it in their lifetime

Citation needed.

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

#170
post #59

Friends dont let friends use #Horracle software. That includes VirtualBox, MySQL, Horracle Cloud. Just step back. Walk away. Do not pass go, do not collect $20000 lawyers fees for unintended actions.

That's quite silly. VirtualBox is great, and so is MySQL. They're also both OSS, so no lawyers in the sense you're implying.
Post reply on HN