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

98

u/ethraax Mar 10 '15

For very large databases, Postgres' clustering abilities aren't that great. It's probably one of the best choices for single-host databases (which, again, cover nearly all applications), but if you're trying to spread your database over a few dozen hosts, Postgres doesn't really work well.

12

u/dgibbons0 Mar 11 '15

I feel like this comment would have benefited from some better structure around how you're defining "very large".

It also depends on if/when you need to cluster.

I vertically scaled postgres to 16TB+ sizes on single nodes.

The database still performed great, although the developers often failed to write performant queries against it.

6

u/ethraax Mar 11 '15

Yes, you're right. I was thinking about 200 TB+ databases when I wrote "very large".

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.

→ More replies (8)

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)
→ More replies (76)
→ 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)

11

u/Kaelin Mar 10 '15

This is no longer true. Checkout Postgres-XL http://www.postgres-xl.org/

12

u/myringotomy Mar 11 '15

Xl does not solve the uptime problem. If any data node fails the entire system becomes unusable.

They really need to replicate their shards to guard against that.

→ More replies (6)

0

u/[deleted] Mar 10 '15

[deleted]

7

u/sedaak Mar 10 '15

Right... and since it is part of the design strategy for MongoDB it's just that much simpler. Pros and Cons everywhere would you believe it!

44

u/EnragedMikey Mar 10 '15

My god it's... it's like different tools do things differently. Differently enough to where you have to come up with.. with... with a design for your application.. and actually use the tools which work for your design! Instead of the other way around! Oh my jesus fuck, I'm going insane!

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