TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Why everyone hates MongoDB

32 pointsby gjmvelosoover 12 years ago

14 comments

lucian1900over 12 years ago
Because it's not a particularly good database, but it's being marketed strongly.<p>There are better (more mature, easier to maintain, faster, etc.) alternatives for both single-machine (Postgres, MySQL) and distributed (Cassandra, HBase) usage.<p>It's a pain to take care of, it does table scans all the time (partly because it has no schema, partly because of design issues), it has pretty poor profiling tools. It's almost impossible to use without a model/schema in the app. Migrations are a pain.<p>The one thing it's particularly well suited at is indexing and searching JSON-like data.
评论 #4970826 未加载
评论 #4970570 未加载
评论 #4970572 未加载
评论 #4970823 未加载
评论 #4970569 未加载
Luytover 12 years ago
I've made a transcription of the famous 'MongoDB is web scale' video, a humorous conversation between a NoSQL fanboy and a more cautious, conventional database developer:<p><i>"'And in conclusion, we have found MySQL to be an excellent database for our website. Any questions?'<p>Yes, I have a question. Why didn't you use MongoDB? MongoDB is a web scale database, and doesn't use SQL or JOINs, so it's high-performance. ...."</i><p>Read the entire conversation at <a href="http://www.mongodb-is-web-scale.com/" rel="nofollow">http://www.mongodb-is-web-scale.com/</a>
评论 #4970817 未加载
评论 #4970997 未加载
ianstallingsover 12 years ago
The plain answer is it's painful using newer technologies. If you use node.js and mongoDB be prepared for working without a net and stumbling across errors that no one has encountered before as it comes to fruition. Be prepared for putting a question out to the community and hearing nothing back. But honestly I've seen the same thing with almost every technology at the beginning of it's life span. If you are a pioneer recognize it and plan accordingly.<p>And if you just chose it willy-nilly because it's a hot tech, well.. You made a mistake.<p>PS - linking to a couple paragraph blog with come conjecture and a link to a google search? That deserves a bitch slap. Try harder.
jcastroover 12 years ago
There's no content in that article other than a link to a google search for "why mongodb is bad".
评论 #4970892 未加载
programminggeekover 12 years ago
It's cool to hate MongoDB, it used to be really cool to like MongoDB. Same thing happend with MySQL probably 10 years ago. I have built some apps with Mongo and it's fine as long as you don't expect it to be a SQL database. A lot of times I wish it had features x,y,z from sql land, and other times I wish MySQL was schemaless.<p>Nowadays, I have begun to defer my database choice until I absolutely have to put an app into production if possible. That way I can write an app and have it working without worrying too much about queries, caching, and so on until I need to actually put it out on a real server.<p>MySQL, Mongo, HBase, Cassandra, Postgres, Riak, Redis, Memcache, Couchbase, Filesystem? It doesn't matter.<p>They're all going to break at different times for different reasons depending on how you use them and what scale you are at. Everything breaks at scale eventually.<p>Build something awesome enough that it breaks under the user load. That's a good problem to have.
评论 #4970599 未加载
评论 #4970714 未加载
freeworkover 12 years ago
The reason why I dislike MongoDB is because it exist in between that key+value store and ful blown database. They market is as the best of both worlds, but it ends up being the wost of each world. Its like all those car+bike, car+boat, car+plane, boat+plane, boat+bike combinations that have been marketed over the years.<p>If I had a bunch of keys and values, I'd put it in memcache. If I had relational data, I'd put it in postgres. I don't see where mongo fits into play. Every time I've seen it used in production, it always seems like its being used as an improperly implemented RDBMS or an improperly implemented key+value store.
mediocregopherover 12 years ago
I'll give the reasons why I hate it, and they have nothing to do with it not being a "good fit" for our model or abstraction problems or anything of that nature. The problem we have with it is that it's an absolute pain to maintain in a large production.<p>The setup alone is just bizarre, for each replica set you have to have 3 (and only 3!) config server instances associated with your set, along with possibly an "arbiter" instance depending on what circumstances you're operating under. I could do a whole rant (and have, in the past, to anyone who would listen) on the arbiter/voting system mongo uses. We've been left in a situation in the past where one of our secondaries randomly died (more on these lovely "random occurences" later), leaving the cluster with a master and an arbiter left over. Mongo decided that since there was an even number of votes (and why is my production-critical database voting on things?!) it couldn't promote a master (even though the master never actually died), dropped the master down to being read-only, leaving us completely boned. They have since fixed this issue (I think), but it definitely garnered a lot of ill-will from me, and should never EVER have even been a problem.<p>"Random occurrences" have always plagued us with mongo. Whether it's been random segfaults (less common with more recent versions, but oh dear god were they frequent pre-2.0), secondaries being promoted to master with no clear reason as to what sparked this (which has left us flailing twice now, when a master decided to step down while one secondary was in RECOVERING mode and the other was AWOL), config servers getting out of sync (one time one of the config server sets decided it was going to start hosting the config for an entirely different replica set, luckily no production mongos instances had to reload the config before we noticed), mongos instances getting out of sync/crashing (less common now than before, thankfully), and I'm sure much more that I'm not thinking of now.<p>To make all of the above about 10x worse the mongo logs are terrible. There is no distinction between INFO messages and ERROR messages in the logs, so everything has to be treated as an error of some kind. And there are many "errors" that we should "just ignore". This makes debugging pretty much impossible. Another nice feature is when you restart a mongos instance (and possibly a mongod instance too, although I could be wrong on that) all the logs from the old process get clobbered by the new one (so backup those logs folks!). It's extremely difficult to track down why slow queries are happening unless you can catch them in the act, and even then it's not trivial.<p>Mongo has many great qualities. It's one of the few (if the only, that I know of) that can do many of the things that it does, and for that it's very useful. But for it to have been marketed as a production-ready database was a bit disingenuous I think. It scales OK. Not well, just OK. You can make it scale if you try real hard and tiptoe around it so you don't wake it up and make it cry. I think someday in the future all of these issues will be fixed, but at the moment I don't recommend anyone use mongo for anything they plan on a significant number (200k+ users at any given moment) of users being dependent on.
评论 #4971797 未加载
评论 #4970889 未加载
评论 #4973194 未加载
评论 #4970903 未加载
overgardover 12 years ago
I wonder if the ease of use of MongoDB might be part of why this "hating on mongo" trend exists -- it's very easy to setup and use without having to think through exactly what the best way to use it is. Which means it's very easy to do something dumb without realizing you're doing something dumb. The problem is, most of these database anti-patterns aren't visible at a small-scale, they only become obvious once the datasets get large and then it's really hard to change things.<p>Pretty much any database is going to leak abstractions at some point, there's absolutely no way of getting around understanding how your DB works. I think the problem with Mongo is that it's so developer friendly initially, that it makes it easy to avoid a lot of hard decisions that will eventually have to be made, and when those decisions do come to the forefront, it's often at a much less convenient juncture in the application's lifecycle to change things.
评论 #4970702 未加载
outside1234over 12 years ago
I'm considering using MongoDB for some limited cases in our app:<p>1. A capped collection of responses from a 3rd party endpoint (XML) that we often want to go back up to 2 weeks and have a look at.<p>2. Data that is all reads after initial write: Historical data, lots of it (100-150M rows and growing fast), that we want to take advantage of the scaleout nature of MongoDB to handle.<p>3. "Built out data": Data that is the summarized output of the ground truth in our MySQL DB that is expensive to compute, has a varying JSON schema, and we want have ready at our fingertips for the frontend.<p>It seems like MongoDB is well suited for these use cases, leaving our transactional and user data in MySQL.<p>Am I crazy? Should I be considering one of the alternatives instead?
评论 #4972259 未加载
ahallockover 12 years ago
I'm not going to argue about the technology itself, but 10gen does provide excellent documentation, screencasts, and tutorials. Other DB vendors could learn a thing or two about writing better documentation and educational materials. Look at <a href="https://education.10gen.com/" rel="nofollow">https://education.10gen.com/</a> and <a href="http://www.10gen.com/presentations" rel="nofollow">http://www.10gen.com/presentations</a> for example.
评论 #4973209 未加载
davidwover 12 years ago
The thing that pissed me off about MongoDB was finding it in an environment where it had no business being because it had been heavily marketed as 'cool!' 'saves time!', 'web scale!', and so on.<p>Besides antirez being a friend, I think something like redis more credible due to the fact that it seems fairly clear about what it is, and what it is not.
kylemaxwellover 12 years ago
"Everyone" may be a bit of hyperbole. I have some particular use cases where it works really well, and others where I wouldn't dream of deploying it. Using any technology "because it's cool" without understanding the implications only works for experimental stuff where that's the whole point.
foobar1988over 12 years ago
It's clear that the easiest way to get to the top of hacker news is to discuss why you hate MongoDB <a href="http://blog.serverdensity.com/does-everyone-hate-mongodb/" rel="nofollow">http://blog.serverdensity.com/does-everyone-hate-mongodb/</a>
Millenniumover 12 years ago
There's an old saying, "If all you have is a hammer, everything else looks like a nail." People hate MongoDB because its makers (and, to a lesser extent, userbase) actively market it as the hammer.
评论 #4970784 未加载