Don't use MongoDB
From CTO of 10gen<p>First, I tried to find any client of ours with a track record like this and have been unsuccessful.  I personally have looked at every single customer case that’s every come in (there are about 1600 of them) and cannot match this story to any of them.  I am confused as to the origin here, so answers cannot be complete in some cases.<p>Some comments below, but the most important thing I wanted to say is if you have an issue with MongoDB please reach out so that we can help.  <a href="https://groups.google.com/group/mongodb-user" rel="nofollow">https://groups.google.com/group/mongodb-user</a> is the support forum, or try the IRC channel.<p>> <i></i>1. MongoDB issues writes in unsafe ways <i>by default</i> in order to win benchmarks<i></i><p>The reason for this has absolutely nothing to do with benchmarks, and everything to do with the original API design and what we were trying to do with it.  To be fair, the uses of MongoDB have shifted a great deal since then, so perhaps the defaults could change.<p>The philosophy is to give the driver and the user fine grained control over acknowledgement of write completions.  Not all writes are created equal, and it makes sense to be able to check on writes in different ways.  For example with replica sets, you can do things like “don’t acknowledge this write until its on nodes in at least 2 data centers.”<p>> <i></i>2. MongoDB can lose data in many startling ways<i></i><p>>  1. They just disappeared sometimes.  Cause unknown.<p>There has never been a case of a record disappearing that we either have not been able to trace to a bug that was fixed immediately, or other environmental issues.  If you can link to a case number, we can at least try to understand or explain what happened.  Clearly a case like this would be incredibly serious, and if this did happen to you I hope you told us and if you did, we were able to understand and fix immediately.<p>> 2. Recovery on corrupt database was not successful, pre transaction log.<p>This is expected, repairing was generally meant for single servers, which itself is not recommended without journaling.  If a secondary crashes without journaling, you should resync it from the primary.  As an FYI, journaling is the default and almost always used in v2.0.<p>> 3. Replication between master and slave had <i>gaps</i> in the oplogs, causing slaves to be missing records the master had.  Yes, there is no checksum, and yes, the replication status had the slaves current<p>Do you have the case number?  I do not see a case where this happened, but if true would obviously be a critical bug.<p>>  4. Replication just stops sometimes, without error.  Monitor
>     your replication status!<p>If you mean that an error condition can occur without issuing errors to a client, then yes, this is possible.  If you want verification that replication is working at write time, you can do it with w=2 getLastError parameter.<p>> <i></i>3. MongoDB requires a global write lock to issue any write<i></i><p>> Under a write-heavy load, this will kill you.  If you run a blog, you maybe don't care b/c your R:W ratio is so high.<p>The read/write lock is definitely an issue, but a lot of progress made and more to come.  2.0 introduced better yielding, reducing the scenarios where locks are held through slow IO operations. 2.2 will continue the yielding improvements and introduce finer grained concurrency.<p>> <i></i>4. MongoDB's sharding doesn't work that well under load<i></i><p>> Adding a shard under heavy load is a nightmare. Mongo either moves chunks between shards so quickly it DOSes the production traffic, or refuses to more chunks altogether.<p>Once a system is at or exceeding its capacity, moving data off is of course going to be hard.  I talk about this in every single presentation I’ve ever given about sharding[0]: do no wait too long to add capacity.  If you try to add capacity to a system at 100% utilization, it is not going to work.<p>> <i></i>5. mongos is unreliable<i></i><p>> The mongod/config server/mongos architecture is actually pretty reasonable and clever.  Unfortunately, mongos is complete garbage.  Under load, it crashed anywhere from every few hours to every few days.  Restart supervision didn't always help b/c sometimes it would throw some assertion that would bail out a critical thread, but the process would stay running.  Double fail.<p>I know of no such critical thread, can you send more details?<p>> <i></i>6. MongoDB actually once deleted the entire dataset<i></i><p>> MongoDB, 1.6, in replica set configuration, would sometimes determine the wrong node (often an empty node) was the freshest copy of the data available.  It would then DELETE ALL THE DATA ON THE REPLICA (which may have been the 700GB of good data)<p>> They fixed this in 1.8, thank god.<p>Cannot find any relevant client issue, case nor commit.  Can you please send something that we can look at?<p>> <i></i>7. Things were shipped that should have never been shipped<i></i><p>> Things with known, embarrassing bugs that could cause data  problems were in "stable" releases--and often we weren't told about these issues until after they bit us, and then only b/c we had a super duper crazy platinum support contract with 10gen.<p>There is no crazy platinum contract and every issue we every find is put into the public jira.   Every fix we make is public.  Fixes have cases which are public.  Without specifics, this is incredibly hard to discuss.   When we do fix bugs we will try to get to users as fast as possible.<p>> <i></i>8. Replication was lackluster on busy servers<i></i><p>This simply sounds like a case of an overloaded server.  I mentioned before, but if you want guaranteed replication, use w=2 form of getLastError.<p>> <i></i>But, the real problem:<i></i><p>> 1. Don't lose data, be very deterministic with data<p>> 2. Employ practices to stay available<p>> 3. Multi-node scalability<p>> 4. Minimize latency at 99% and 95%<p>> 5. Raw req/s per resource<p>> 10gen's order seems to be, #5, then everything else in some order.  #1 ain't in the top 3.<p>This is simply not true.  Look at commits, look at what fixes we have made when.  We have never shipped a release with a secret bug or anything remotely close to that and then secretly told certain clients.  To be honest, if we were focused on raw req/s we would fix some of the code paths that waste a ton of cpu cycles.  If we really cared about benchmark performance over anything else we would have dealt with the locking issues earlier so multi-threaded benchmarks would be better.  (Even the most naive user benchmarks are usually multi-threaded.)<p>MongoDB is still a new product, there are definitely rough edges, and a seemingly infinite list of things to do.[1]<p>If you want to come talk to the MongoDB team, both our offices hold open office hours[2] where you can come and talk to the actual development teams.  We try to be incredibly open, so please come and get to know us.<p>-Eliot<p>[0] <a href="http://www.10gen.com/presentations#speaker__eliot_horowitz" rel="nofollow">http://www.10gen.com/presentations#speaker__eliot_horowitz</a>
[1] <a href="http://jira.mongodb.org/" rel="nofollow">http://jira.mongodb.org/</a>
[2] <a href="http://www.10gen.com/office-hours" rel="nofollow">http://www.10gen.com/office-hours</a>