Retrospective from Postmark on outages (MongoDB)
blog.postmarkapp.com
blog.postmarkapp.com
10gen put out claiming MongoDB was so much faster than SQL solutions but it seemed obvious to me than turning off fsync would make the SQL solutions run at about the same speed. Plus, why would I want to run my database in mode where it is easy to lose data? MongoDB may be a useful product but their marketing is deceptive, which will lead to companies using it in inappropriate situations.
As for your second paragraph, MongoDB has had journalling for quite a while, so you can make you writes durable and limited to the speed of your storage.
Is there a benchmark somewhere comparing the memory/disk consumption of MongoDB vs. other datastores?
If there's a significant overhead (and my early tests tend to show that there was - but I didn't make a strict benchmark though), then it would become very related to MongoDB then.
(honest and real question, I'm a MongoDB user btw, as well as Redis, MySQL, Postgresql etc).
Of course this can be solved fairly easily by the MongoDB developers by having a table mapping between short tokens/numbers and the long names. This is the ticket:
https://jira.mongodb.org/browse/SERVER-863
This is someone's measurements with different key names:
http://christophermaier.name/blog/2011/05/22/MongoDB-key-nam...
My question goes further though, as someone who has worked with, and implemented too, column-based stores: I'm curious to compare the respective space/ram consumption for the data part, too.
I think I'll write such a benchmark one day :)
The journaling is only fsynced every so-often - its not like it magically gives you anything like the D in ACID.
This leaves you relying on replication for durability.
And everyone has problems when they lose one of the cluster.
Luckily it wasn't the lot: http://blog.empathybox.com/post/19574936361/getting-real-abo...
I would love to be corrected; we'd all sleep easier.
http://www.mongodb.org/display/DOCS/Journaling
So yes it is periodic by default (in the millisecond range). However you can wait on any request until it has become durable.
As for replication, people seem to have some hate for that, but the reality is that a journalled system that has failed (any database/operating system) will take a large amount of time to come back up, replay/recover journals etc. Not that useful.
I would say that MongoDB durability used to be an issue, but now with journaling and replica sets it's not as much of a concern.
There were two reasons why the secondary was less capable than the primary. First, the data had become very fragmented due to our frequent purging. And second, we were in the middle of an upgrade to our servers and that one had not been tackled yet. The primary failure came at a bad time. I could have clarified that better in the post.
Regarding capped collections, yes they are faster. The problem is that they can't be sharded. With our dataset that would not allow us to scale.
I hope they just overlooked that in the blog post, rather than actually not correcting this first.
Split out the heavy stuff on to other servers.
Then have emergency flags in the webapps so you can run them in a low feature mode. If you bake this concept in when you're building the webapps dealing with drama is much less stressful.
I have no opinions on MongoDB, but it really seems like this particular problem was because they skimped on disaster recovery, ie. their failover hardware was less powerful than their production hardware. That was the root cause of their downtime, which is inadequate planning.
That's spending money on car insurance, but realizing only after you get into an accident that the car insurance covers almost nothing. It means you've wasted your money paying for the insurance. They paid for the secondary failover hardware, but it was effectively useless since they were down for 2 days. The only thing it mitigated, possibly, was how long they were down for, but the primary objective of the hardware, ie. keep them up in case of a disaster, was a complete failure.
I've worked at a company that was completely down for a day worldwide due to a "disaster", even though we had spent millions on diesel fuel generators, etc. I blame the "checkbox" mentality where people only look to satisfy requirements, but no one actually has ownership over the process and the details. Unfortunately, in my case, no one got fired over this complete misstep, which is another problem... zero accountability.
Even normal upgrades (hardware fails - it's a question of when, not if) could be handled transparently just by making the "secondary" server a first-class citizen.
In any event this problem is one of success. That is the kind of problem I prefer having.
This includes equality in failover systems. The common issue in all of these cases is not the DB engine, OS, stack, whatever, but the infrastructure.