Live data from Hacker News

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

news.ycombinator.com

51–60 of 366 posts

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

#51
post #11

The difference is not significant enough to matter for most projects, esp just starting out. Hence, I mostly choose Postgres, since I don't like Oracle as a company very much.

Whenever I see MySQL, my brain automatically sees MariaDB. What is this Oracle thing you speak of ;-)

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

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

Hasnt been the case for a few major versions, unless you want to anthropomorphise your db and and hold it accountable for past behaviour.

> unless you want to anthropomorphise your db and and hold it accountable for past behaviour

No one is holding the literal bits that make up the database executable accountable here, they are indicating they don't trust the devs of MySQL/MariaDB to do a good job. Whether or not that is an accurate view on their part is arguable, but it's pretty clear from context that they don't think that several if/else statements had it out for them.

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

#53
post #37
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…

> 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. Unicode generally "just works" if the charset in use is utf8mb4. As of MySQL 8.0, this is the default.

Ah, that's good to hear. I haven't looked seriously at databases other than SQLite for a long time, it would be interesting to see a more up to date evaluation.

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

#54
post #15

MySQL for the quick and dirty and Postgres for anything else

Why is mysql better for quick and dirty? I feel like pg extensions offer a lot more "dirtiness" running inside pg than mysql has.

yeah that's a weird take. if you want quick and dirty you use sqlite and if you need something more you go with postgres. some replication things are nicer in mysql apparently but postgres is the better option for most workflows

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

#55
post #38

Use MySQL if you're expecting to have to do large operational database tasks re: migrations, maintenances, with no ability to go offline. gh-ost, percona-osc, the new INSTANT DDL stuff, is all quite far ahead in MySQL-land. Additionally, Vitess and Planetscale are making huge strides in MySQL performance. There are more people and guides in the world to help recover even the most mutilated of MySQL databases. MySQL g…

This is wrong. MySQL does not support transactional DDL, so you cannot run migration and abort them in the middle.

Always use postgresql. It's more logical, more extensible, saner, supports many extensions and is more predictable.

MySQL is inconsistent crap, that trades away consistency, correctness and stability for a little bit of performance in standard use cases.

Do yourself a favor and always use postgreSQL. I switched 15 years ago and never looked back. Have done 15-50 projects since in psql.

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

#56

> What sort of functional requirements would cause you to choose one over the other? Simple: I don't like having headaches. Therefore, I chose postgres.

Not even funny or clever, and definitely not helpful to the actual question being posed

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

#57

Most answers seem written by fanboys rather than legit answers. I would say go with what you know and are most comfortable with. You are more likely to get the better outcome.

This.

I've heard countless times that Postgres is better and I've watched talks where they show how loosey-goosey MySQL is with some things but I know how to backup, restore, tune, secure and replicate MySQL. I grok it's permissions in depth more than I ever have with Postgres and I've even written a mysql plugin in C so I have that in my toolbox if I need it. So I'd by default, usually go with MySQL (or in some cases SQLite.) but if I didn't have to administer or maintain it, and someone else was handling that I think I'd be fine with Postgres too.

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

#58
I've been using MariaDB (MySQL) as a hobbyist for years. I just set up a couple myqsql servers with phpmyadmin on Raspberry PIs and use them for local development. Basic crud apps, etc.

I've always assumed that PostgreSQL is a step up, but never really bothered to look into what I get for the effort. Do I really get anything if I'm not trying to make apps at scale?

Post reply on HN