Live data from Hacker News

Never, ever, ever use MongoDB

cryto.net

21–30 of 122 posts

Re: Never, ever, ever use MongoDB

#21
post #6

I, well, one my companies, have been using mongo for a while without any problems. I cannot comment about is reliability but as a business tool, in the niche area we operate, it served us well. I've got nothing against relation databases but there are not a solution to every single problem. Heck, why not decide first if you can use flat files? Do you really need to query and join. Not all problems require that sort o…

> I, well, one my companies, have been using mongo for a while without any problems. I cannot comment about is reliability but as a business tool, in the niche area we operate, it served us well.

The issues I listed provably exist. That you haven't run into them yet doesn't change that - and quite likely, you might not even know whether you've run into it.

Losing data or having your database open to the wide internet, for example, are two scenarios that you will likely not be aware of unless you explicitly test for them.

> I've got nothing against relation databases but there are not a solution to every single problem.

And if you'd read my post carefully, you would've seen that I make no such claim. They do solve many problems, however.

> Heck, why not decide first if you can use flat files?

Flat files are rarely the correct solution. Race conditions ahoy!

> Do you really need to query and join. Not all problems require that sort of thing.

Many do. And even if they don't, MongoDB is still not the right choice.

Re: Never, ever, ever use MongoDB

#23
post #9

I think people only use it because it stores JSON and let's you query it arbitrarily on demand. It appears to be as good as CouchDB, but with on-demand queries, as good as Postgres, but with JSON (!). It appears to be quick and easy and the tool for the job. Also, when people say NoSQL they actually mean MongoDB.

> as good as Postgres, but with JSON (!).

PostgreSQL has supported JSON for a good while now, I've even explicitly linked to it in my post. And no, MongoDB is certainly not 'as good' - many of the problems listed simply do not exist in PostgreSQL.

Re: Never, ever, ever use MongoDB

#24

Or: You could just RTFM and avoid all these issues. For example: The message warning you that 32bit builds are not safe for storing more than 2GB of data is larger than the download button itself. If don't see this, you should probably be not in charge of storing any data anyways. Many other issues have been resolved with the 3.0 release or are documented very clearly.

> The message warning you that 32bit builds are not safe for storing more than 2GB of data is larger than the download button itself. If don't see this, you should probably be not in charge of storing any data anyways.

That's all well and good, but reporting writes as successful and silently failing when your data ticks over 2 GB instead of throwing errors or doing something useful like that is more what the complaint is about. Obviously, you could set up monitors on your data storage and alarm if it reaches 1.75 GB, but if you're mature enough to do that, you're mature enough to use a real database solution.

Re: Never, ever, ever use MongoDB

#25
post #12

Been there, done that. Spent over a year trying to make Mongo behave like a decent DB, and it would still fail to do so. Actually, I wrote a small "goodbye letter" to MongoDB on HN in the past: "You got your chance, Mongo, and you screwed it up. I tried getting the most out of you. I treated you like a princess, I indulged you, your wishes became my wishes and your thoughts were my thoughts. I stopped listening to al…

[deleted]

Re: Never, ever, ever use MongoDB

#26

Or: You could just RTFM and avoid all these issues. For example: The message warning you that 32bit builds are not safe for storing more than 2GB of data is larger than the download button itself. If don't see this, you should probably be not in charge of storing any data anyways. Many other issues have been resolved with the 3.0 release or are documented very clearly.

The author is cataloguing some of Mongo's "paper cuts," i.e., issues for which warnings and known workarounds exist but that really make the development experience less pleasant.

For MongoDB's actual limitations, read aphyr's Call Me Maybe series.

Re: Never, ever, ever use MongoDB

#27
post #5

Earlier quoted context omitted.

If your data really doesnt matter you might as well just use ElasticSearch as a document store, its a lot easier anyways

I doubt ElasticSearch is easier to set up and get started with than MongoDB, especially if you're coming from limited knowledge about either.

ElasticSearch is trivial to set up, especially if we're talking about a small project like a hackathon.

It's not without its problems but ES's first-fifteen-minutes story is pretty good.

Re: Never, ever, ever use MongoDB

#28

Or: You could just RTFM and avoid all these issues. For example: The message warning you that 32bit builds are not safe for storing more than 2GB of data is larger than the download button itself. If don't see this, you should probably be not in charge of storing any data anyways. Many other issues have been resolved with the 3.0 release or are documented very clearly.

1. There was no such warning for a long, long time. 2. It's a dumb limitation, and an architectural issue as far as I'm concerned. 3. It still doesn't justify silently throwing away data for years. 4. Many of the points on my list remain unaddressed, and likely never will be addressed. EDIT: Additionally, the typical system administrator doesn't install MongoDB from the 'Downloads' page, but uses a package manager, a…

yousoundmad

Re: Never, ever, ever use MongoDB

#29
post #4

How would one use Meteor.js without MongoDB though? Are you saying not to use Meteor.js too? I was thinking about maybe toying with the idea of making a fully reactive RethinkDB package for Meteor.js.

I recommend setting aside these scare stories about mongodb after you read the instructions on how to check that writes succeed, and look into replication. Sure mongodb has its problems but a few years ago I helped a customer run mongodb at very large scale.

Meteor.js is a fantastic development system (if you can live with needing sticky sessions and you need its features).

Re: Never, ever, ever use MongoDB

#30
post #15
post #2

Not even a hackathon?

MongoDB has THE WORST vendor lock-in imaginable, so only use it if you know that you could throw everything away. Source: my last employer used MongoDB, and switching to an RDBMS would have forced us to rewrite ~80% of the codebase.

About 80% rewrite: it is poor abstraction problem rather then vendor lock-in one
Post reply on HN