Hacker News new | past | comments | ask | show | jobs | submit login
MongoDB fails to perform, runs out of gas (couchbase.com)
12 points by skjhn on June 24, 2016 | hide | past | web | favorite | 4 comments

I been learning MongoDB and I have a project in mind using it.

Did they test against a single MongoDB server or a cluster?

"MongoDB executes every query on every node because it relies on local indexes – every node contains just a piece of the index. As a result, query performance is limited to that of a single node. For example, if a single node can execute 7,500 queries per second, adding more nodes does not help – every node still has to execute the same 7,500 queries per second."

Well if you pick a good shard key it should be able to go to a single node. Not sure why they didn't mention that. I'd take this with a grain of salt, since they're a competitor. I'm curious if they setup indexes, etc in MongoDB. I'd read the full report but I don't want to input my phone number so I can most likely be called by salespeople.

"Did they test against a single MongoDB server or cluster?"

Couchbase: 9 nodes on 9 AWS instances (1 node per instance). MongoDB: 18 nodes on 9 AWS instances (1 primary and 1 secondary per instance).

"Well if you pick a good shard key it should be able to go to a single node."

Not necessarily. From the docs: In some cases, when the shard key or a prefix of the shard key is a part of the query, the mongos can route the query to a subset of the shards. Otherwise, the mongos must direct the query to all shards that hold documents for that collection.

If you query your data in many ways, you have lots of queries not based on the shard key. Considers users. What do you shard on, email? What if you want to query by location, age, status, and/or preference?

Oh wow. More MongoDB servers and it did worse? That's really surprising and disappointing for MongoDB.

hmm and good point. It does seem like shard key would be possibly limited to just 1 common query. I haven't really got to that part yet myself, just going by what I've learned so far in the class I'm taking.

edit: oh reread. 2 servers per instance, not the same amount of actual server instances. I wonder if you ran 1 per instance if you'd get better results...

I know the MongoDB people seem to hype it up and some large companies are using it. The system does seem like a good dream if it worksout.

Sort of. One of the requirements was replication. The databases had to replicate every document so that it was stored on two different nodes. This ensures availability. The only way to do that with MongoDB is to run secondary nodes too. Now, it's possible to do say 4 primary and 4 secondaries, but performance would go down because only 4 nodes could do the writing. The problem is that it rarely works out. It's fine at first, but down the road...

Applications are open for YC Summer 2020

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact