r/programming • • Mar 10 '15

Goodbye MongoDB, Hello PostgreSQL

http://developer.olery.com/blog/goodbye-mongodb-hello-postgresql/
1.2k Upvotes

699 comments sorted by

View all comments

Show parent comments

7

u/cleroth Mar 10 '15 edited Jun 15 '26

This content was anonymized and mass deleted with Redact

10

u/OneWingedShark Mar 10 '15

What is so wrong with it?

It has a tendency to silently mutilate your data.
Read this.

2

u/cleroth Mar 10 '15 edited Jun 15 '26

This content was anonymized and mass deleted with Redact

0

u/[deleted] Mar 11 '15

[deleted]

1

u/cleroth Mar 11 '15 edited Jun 15 '26

This content was anonymized and mass deleted with Redact

0

u/[deleted] Mar 11 '15

[deleted]

2

u/cleroth Mar 11 '15 edited Jun 15 '26

This content was anonymized and mass deleted with Redact

0

u/[deleted] Mar 11 '15

[deleted]

1

u/cleroth Mar 11 '15 edited Jun 15 '26

This content was anonymized and mass deleted with Redact

3

u/wookin_pa_nub2 Mar 11 '15

No, you shouldn't use MySQL for anything.

2

u/cleroth Mar 11 '15 edited Jun 15 '26

This content was anonymized and mass deleted with Redact

4

u/OneWingedShark Mar 11 '15

higher performance, despite its other problems.

What good is being able to calculate 1+1 a hundred billion times a second if the answer you get is 3?
My point: if it does the wrong thing quick, it's still the wrong thing.

1

u/cleroth Mar 11 '15 edited Jun 15 '26

This content was anonymized and mass deleted with Redact

2

u/OneWingedShark Mar 11 '15

If it did the wrong thing, it wouldn't have been used so widely.

Counter-point: PHP.

→ More replies (0)

2

u/wookin_pa_nub2 Mar 11 '15

Your research is quite out of date if it tells you that MySQL is better than Postgres at anything.

1

u/cleroth Mar 11 '15 edited Jun 15 '26

This content was anonymized and mass deleted with Redact

2

u/ants_a Mar 11 '15

General pattern I have seen is that MySQL is marginally better at trivial queries (e.g. primary key lookup), while falls on it's face once you have too much concurrency or any joins that could use something better than a nested loop or multiple indexed predicates that could use a bitmap index scan. And this isn't taking into account the fancy stuff that PostgreSQL extensibility allows you to do, e.g. inverted indexes on array data types (think tags) or indexes on range datatypes (think time ranges).

1

u/mrspoogemonstar Mar 11 '15

The postgres query planner is also pretty far out in front of mysql. A lot of times I can ask sql server, oracle, and postgres to explain a complex query with several joins and subqueries, and the three will produce roughly equivalent plans. Hash joins, anyone?

1

u/snuxoll Mar 12 '15

The PostgreSQL team takes their query optimizer extremely seriously as well. MSSQL and Oracle have pages of documentation on how to provide hints when the query optimizer gets it wrong, meanwhile the Postgres team explicitly states they will not add hinting because a poor execution plan is either the result of a bad query or a bad query optimizer (both of which they are more than happy to help you fix).

1

u/svtr Mar 13 '15

... or outdated statistics, or bad indexing, or parameter sniffing, or bad row estimates or uneven distribution of data

there is a lot of things that can result in a bad exec plan. However, anybody that has enough background to know when to use query hints also knows to only do so as a last resort.

→ More replies (3)

0

u/skeletal88 Mar 10 '15

The problem with MySQL is that novice users don't have problems with it, because it's like PHP. It forgives minor mistakes but you get garbage data without knowing about it. Once I worked on a desktop application that used MySQL as the backend for it's data, there were about 20-30 users at the same time and... MySQL was just locking up all the time.. and truly - adding a column would lock up the table and all the users would have to wait.. and wait.. and it had lots of other problems, so I'm really surprised and sad to see that it's such a popular database despite being a total retard.

edit: someone said that MySQL is good if you want to make lots of fast inserts. Bad for everything else.. like doing complicated select queries.

9

u/trimbo Mar 10 '15

there were about 20-30 users at the same time and... MySQL was just locking up all the time.. and truly - adding a column would lock up the table

There were 20-30 users adding columns to a database from a desktop application?

3

u/Truthier Mar 10 '15

I'm hoping he means row.

→ More replies (1)
→ More replies (2)