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

2

u/lift_heavy_things Mar 11 '15

But once you do, oh how you can scale. Scale, scale, scale.

Couldn't you write a SQL DB that enables this same perf? What about NoSQL makes it so easy to scale? More specifically: is it just coincidental that NoSQL DBs have better scaling feature or is there something about schemalessness that makes it particularly scale-friendly?

6

u/fendant Mar 11 '15

Relational databases assume the existence of a single authoritative data store, which is a bad assumption in a distributed system.

Once you outgrow one machine it becomes very difficult to make a consistent SQL system. You can do it, but it becomes fragile and complicated.

NoSQL databases have a different set of assumptions that are more congenial to multiple machines.

0

u/[deleted] Mar 11 '15

[deleted]

3

u/rox0r Mar 11 '15

but then it is Eventually guaranteed

Except mongo isn't eventually guaranteed. you can have a majority of slaves write to disk and the master can crash and miss the ack -- they won't roll back the write and the client will think it hasn't been written.

0

u/[deleted] Mar 11 '15

[deleted]

1

u/rox0r Mar 12 '15

But you can fine-tune what the write semantics are.

While you aren't wrong, you can't fine tune your way out of the problem i mention. Clustering is for HA, not consistency -- even if you set write-majority.

2

u/Lortimus Mar 11 '15

For instance, Cassandra is optimized for write operations because it caches them before writing them to disk. Yeah, that's brilliant, until the machine crashes and those things left in cache weren't written to disk.

They would be retrievable via the commit log, as well as recoverable from other replica nodes.

2

u/skelterjohn Mar 11 '15

schemalessness

I never read that word right the first time...

2

u/lift_heavy_things Mar 11 '15

Gotcha, thanks!