Live data from Hacker News

PostgreSQL Outperforms MongoDB in New Round of Tests

blogs.enterprisedb.com

161–170 of 171 posts

Re: PostgreSQL Outperforms MongoDB in New Round of Tests

#161
post #147

Earlier quoted context omitted.

Postgres has first-class arrays too: http://www.postgresql.org/docs/9.3/static/arrays.html

Can you atomically increase one element of that array by 2 without a big chunk of code?

Yes, see the array operations section of the docs.

Re: PostgreSQL Outperforms MongoDB in New Round of Tests

#162

Earlier quoted context omitted.

This is an excellent post. You've answered a question I've had for a while - are there any circumstances where MongoDB is the right tool for the job? You seem to be on point that Mongo is currently the best for frequent updates of JSON blobs. Thank you. I'll take issue with a couple of points, though. Postgres has arrays: http://www.postgresql.org/docs/9.3/static/arrays.html Rapid counting of increments can be done f…

It does have arrays, but they aren't first class to the same extent as MongoDB. * A Postgres Array can end up being stored elsewhere, whereas in MongoDB an array will be contained within the document * I am also not clear on what exactly can be stuck inside an array (In MongoDB it can be an object that contains more arrays) while maintaining first-class access and updates. I would love to find more detailed informati…

"stored elsewhere" doesn't make sense to me. Arrays are part of the tuple as much as any other attribute type.

You can store anything in an array that you can store as an attribute of a row. There may be some edge cases I don't know about, but generally anything that can be a column can be an array element.

Re: PostgreSQL Outperforms MongoDB in New Round of Tests

#163

Will be great if PostgreSQL ends up as a storage engine option in MongoDB like InnoDB. Then you have the better engine of PostgreSQL with the superior clustering, sharding and end user experience of MongoDB. That said these articles are pretty pointless. Performance isn't the reason companies are switching to MongoDB.

How about implementing MongoDB API on top of the PostgreSQL? Then sell it companies which started with MongoDB, but run into some scalability/reliability issues.

[deleted]

Re: PostgreSQL Outperforms MongoDB in New Round of Tests

#164

Will be great if PostgreSQL ends up as a storage engine option in MongoDB like InnoDB. Then you have the better engine of PostgreSQL with the superior clustering, sharding and end user experience of MongoDB. That said these articles are pretty pointless. Performance isn't the reason companies are switching to MongoDB.

How about implementing MongoDB API on top of the PostgreSQL? Then sell it companies which started with MongoDB, but run into some scalability/reliability issues.

IBM already does this with DB2 http://www.theregister.co.uk/2013/06/05/ibm_db2_mongodb/

Re: PostgreSQL Outperforms MongoDB in New Round of Tests

#165

Will be great if PostgreSQL ends up as a storage engine option in MongoDB like InnoDB. Then you have the better engine of PostgreSQL with the superior clustering, sharding and end user experience of MongoDB. That said these articles are pretty pointless. Performance isn't the reason companies are switching to MongoDB.

How about implementing MongoDB API on top of the PostgreSQL? Then sell it companies which started with MongoDB, but run into some scalability/reliability issues.

[deleted]

Re: PostgreSQL Outperforms MongoDB in New Round of Tests

#166
post #79

Earlier quoted context omitted.

Is MongoDB's distribution and scaling story really nicer? A cluster story that's easy to set up but then doesn't actually work (loses data, fails in potentially catastrophic ways) sounds not all that useful. http://aphyr.com/posts/284-call-me-maybe-mongodb

Mongodb is easy to setup as a single instance, but it is definitely no easier to setup for horizontal scaling compared to alternatives. I'm still not aware of anything that's both simple to setup and maintain for horizontal scaling in practice (not theory).

Cassandra is, but you're forced into a very simplistic data (sharding) model. (And probably Riak is too, but haven't used it.)

Re: PostgreSQL Outperforms MongoDB in New Round of Tests

#167

Earlier quoted context omitted.

I wonder if Node.js will follow the same fate...get a nice dose of reality check. It is mistakenly evangelized as also being faster, leaner, scalable, more concurrent than anything out there. Some clients would pay extra to redo CRUD using Node.js because it's "Asynchronous and We wanna Pay For Speed and Scalability".

My understanding is that people pick node.js because of simplicity and not for speed.

Wow. That's interesting, I really did not find asynchronous programming easy, with basic things like hooking up to database requiring you to go deeper into a chain of callbacks, forcing you to rely on duct tape solutions like futures or whatever they use now to work around the limits of Javascript, or having to write stuff in Coffeescript.

But some devs swear by it, I just fail to see what the advantages are.

Re: PostgreSQL Outperforms MongoDB in New Round of Tests

#168
post #147

Earlier quoted context omitted.

Can you atomically increase one element of that array by 2 without a big chunk of code?

Yes, see the array operations section of the docs.

http://www.postgresql.org/docs/9.3/static/functions-array.ht...

where?

Re: PostgreSQL Outperforms MongoDB in New Round of Tests

#169
post #166

Earlier quoted context omitted.

Mongodb is easy to setup as a single instance, but it is definitely no easier to setup for horizontal scaling compared to alternatives. I'm still not aware of anything that's both simple to setup and maintain for horizontal scaling in practice (not theory).

Cassandra is, but you're forced into a very simplistic data (sharding) model. (And probably Riak is too, but haven't used it.)

Cassandra is easier to scale than mongo, and yeah Riak is even easier, but they're still not easy unless you don't care as much about consistency and you can wait, and if your app is more about writes than reads.

Re: PostgreSQL Outperforms MongoDB in New Round of Tests

#170

Earlier quoted context omitted.

How about implementing MongoDB API on top of the PostgreSQL? Then sell it companies which started with MongoDB, but run into some scalability/reliability issues.

Someone's already done a proof of concept of this, see https://github.com/JerrySievert/mongolike

This is the thing I was actually thinking of when I posted the above. This is a background worker (runs within PostgreSQL) speaking the mongo wire protocol: https://github.com/umitanuki/mongres

Again, very basic PoC.

Post reply on HN