r/programming • • Sep 24 '20

PostgreSQL 13 Released!

https://www.postgresql.org/about/news/2077/
1.3k Upvotes

236 comments sorted by

View all comments

Show parent comments

21

u/G_Morgan Sep 24 '20

MySQL used to eat data in the past so a lot of people dumped it around that time.

0

u/[deleted] Sep 24 '20

[deleted]

24

u/[deleted] Sep 24 '20

Lots of people think data integrity doesn’t matter. Until it bites them in the ass during “that one moment”.

Building in automatic data healing/recovery into your entire stack isn’t easy. That one place you didn’t put in recovery will end up being a critical issue one day.

If you’re using MySQL as an ordered cache for advertising, obviously losing the integrity really doesn’t matter. But that’s a rather special case that I’ve witnessed in between all the other improper uses of MySQL 5 in my short 10 year career

7

u/JB-from-ATL Sep 24 '20

Both jobs I've had I don't think they use foreign keys. It boggles my brain.

5

u/pezezin Sep 24 '20

MySQL didn't properly support foreign keys for a long time, and even though they were added about 15 years ago, even today many people keep working with that mindset. A few months ago I was shocked to find that Wordpress doesn't define foreign keys.

Another fun fact is that MySQL didn't have real support for CHECK constraints until two years ago. You could define them, but they were ignored. That bite me in the ass a couple of times...

5

u/[deleted] Sep 24 '20

And with reason, if one can't trust the db to keep data wth are we even in this world for. Db has one purpose, keep data if can't do that than it's broken.

0

u/[deleted] Sep 24 '20

[deleted]

1

u/Somepotato Sep 25 '20

Sometimes you want both so you use postgres. If you want fast over db integrity, use redis not mysql.

1

u/JB-from-ATL Sep 24 '20

I believe Mongo had the same start. And similarly I think both of these had options to make them more reliable but they weren't the default.

0

u/[deleted] Sep 24 '20

[deleted]

2

u/JB-from-ATL Sep 24 '20

Really takes "works on my machine" to a whole new level.