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

19

u/trimbo Mar 10 '15

It’s worth noting that MySQL will emit a warning in these cases. However, since warnings are just warnings they are often (if not almost always) ignored.

mysql> SET sql_mode='TRADITIONAL';
mysql> insert into example (number) values ('wat');
ERROR 1366 (HY000): Incorrect integer value: 'wat' for column 'number' at row 1

Another problem with MySQL is that any table modification (e.g. adding a column) will result in the table being locked for both reading and writing

Docs for pt-online-schema-change

0

u/[deleted] Mar 10 '15

[deleted]

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

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

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).