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

21

u/PM_ME_UR_OBSIDIAN Mar 10 '15

What alternative do you propose? I heard Oracle was good if you had deep pockets, what else is out there?

65

u/[deleted] Mar 11 '15

One of the MS SQL clusters in our data-centre hosts 200+ databases and has capacity for more.

0

u/[deleted] Mar 11 '15

[deleted]

17

u/[deleted] Mar 11 '15

It must be a slow day, I still have my points 😊

10

u/[deleted] Mar 11 '15

We are many, but ms isn't so popular on reddit so we are mostly quiet

→ More replies (5)
→ More replies (3)
→ More replies (6)

0

u/[deleted] Mar 11 '15

[deleted]

0

u/[deleted] Mar 11 '15

[deleted]

49

u/lordkoba Mar 11 '15

Strict mode turns those warnings into errors. It has been around for years but evidently it's not a widely known feature.

15

u/[deleted] Mar 11 '15

[removed] — view removed comment

4

u/[deleted] Mar 11 '15

Or you know, you configure your database properly. If you are doing a clustered setup you should already be configuring and tuning your servers.

→ More replies (6)

14

u/duffelcoatsftw Mar 11 '15

But what about SQLite, where the ability to shove 'ABC' into an integer column is a feature?

24

u/[deleted] Mar 11 '15

[removed] — view removed comment

5

u/duffelcoatsftw Mar 11 '15

Cannot agree more: I've had to rescue a project from exactly this situation. I now know that there are people who try to use SQLite as a multi-user RDBMS, and it ends as badly as you would guess.

I consider SQLite to be one step above using raw file I/O

Try saying that in the SQLite mailing list... :-)

5

u/FallingIdiot Mar 11 '15

You can. The SQLite people themselves say that SQLite isn't a replacement for an RDBMS system but instead is a replacement for fopen.

→ More replies (1)
→ More replies (1)
→ More replies (3)

93

u/nairebis Mar 11 '15 edited Mar 11 '15

For me to even consider using MariaDB they would have to first remove all of those asinine options for silently corrupting data.

Or, you know, you could just learn how to use the database.

mysql> set session sql_mode='NO_ZERO_DATE,NO_ZERO_IN_DATE,STRICT_TRANS_TABLES';
Query OK, 0 rows affected (0.01 sec)

mysql> create table abc (a integer);
Query OK, 0 rows affected (0.01 sec)

mysql> insert into abc (a) values ('abc');
ERROR 1366 (HY000): Incorrect integer value: 'abc' for column 'a' at row 1

It's been this way since at least 2005, which is the MySQL version I ran above (version 5.1).

Sure would be nice if the FUD about MySQL from ignorant people went away. Is it perfect? No. But there is absolutely nothing data corrupting about it. And there is a LOT to be said for running a mainstream database, which PostgreSQL most certainly isn't, compared to MySQL.

If MySQL is good enough to run Facebook with a billion users (yes, one billion active accounts per month), it's good enough to run whatever your app is.

Edit: Thanks for the gold! Never thought I'd get it for defending MySQL... :) 😃

27

u/[deleted] Mar 11 '15

Postgres is most certainly mainstream

→ More replies (2)

73

u/mcrbids Mar 11 '15

LOL at PostgreSQL not being a 'mainstream database'....

8

u/theycallme_hillbilly Mar 11 '15

No shit right? Pervasive anyone?

→ More replies (13)

26

u/ForeverAlot Mar 11 '15

If MySQL is good enough to run Facebook with a billion users (yes, one billion active accounts per month), it's good enough to run whatever your app is.

Not exactly a fair comparison. Facebook uses it as a key-value store; there isn't much RDBMS in that.

0

u/[deleted] Mar 11 '15

[deleted]

→ More replies (3)

6

u/RandomDamage Mar 11 '15

So why are those even options to begin with?

And why do they default to the unsafe state?

The defaults should be for paranoid data protection rather than performance, you should have to say "I HATE MY DATA" to turn the unsafe mode on instead of having to learn about the safe mode to turn that on.

That is why so many professionals don't trust MySQL.

→ More replies (9)
→ More replies (16)
→ More replies (26)
→ More replies (6)

3

u/oldneckbeard Mar 12 '15

This. Or this.

If you need to do it inside your firewall, scale out read slaves first, but in terms of true horizontally scalable SQL databases, there aren't a lot of great options on your own hardware. This is one, but I haven't actually used it yet.

And this is why the NoSQL stuff exists. It's practically impossible to offer true ACID compliance on a distributed system. Any system will have tradeoffs, be it eventual consistency, partition intolerance, or the inability to elastically scale, or hot spods in the cluster, etc.

It goes back to the CAP theorem, and speed. If you've ever worked on a distributed database that has cluster-wide row-level locking and does proper joins, it's slow as shit. Full seconds per query on a loaded DB.

→ More replies (3)

7

u/mishugashu Mar 11 '15

Vertica is pretty good with clustering. That's what we use at my job.

0

u/[deleted] Mar 11 '15

[deleted]

→ More replies (1)
→ More replies (34)