MongoDB Cost Breakdown

No conversation about hosted MongoDB can be complete without someone bringing up cost. Though generally not a software team’s number one concern–it’s certainly in the top three. You could argue that someone who works for a hosted database service showing cost breakdowns might be tempted to skew the numbers–so I provide citations where available.

We should begin by saying these figures are rough estimates based on feedback from some of our thousands of customers–and the research we checked seemed to support that. This doesn’t mean you should not run up your own figures. This is also not meant to imply that MongoDB costs more than any other database to manage. That’s, again, an individual matter, but in our experience Mongo actually costs less for the types of distributed architecture it supports.

Let’s begin with the most expensive aspect of any software system: labor (all costs are in USD as of Dec 16, 2011).

Labor Costs

Your average MongoDB employee will rake in about $95,000 a year. If that seems spendy, the average DBA nets $2,000 more. Of course, add on top of this benefits, payroll taxes, office space, etc, and you’re looking at nearer to $120,000/yr–or a cool $10,000 a month for a MongoDB administrator.

If you’re smaller, you likely won’t have a dedicated administrator–so this is a wash, right? Well, not quite. I’ll use my previous employer as an example.

Like every overconfident developer, I was certain the whole process would only take a day. But I didn’t know what I didn’t know–and two weeks later we had a running Mongo system in production. Day one was easy. Install the OS, tools, patches, and MongoDB. Day two and onward was learning to administer, secure, optimize, handle backups and restores, and so on. That entire process cost my company $5,000 in time, with a labor maintinence of approx. 10 minutes a week per person, as folks wrestled with a poorly configured system. That’s a cost of about $500 per month spread across our 11 man team.

Or we could have set up the same system plus replication, hosted for $149 a month in 15 minutes, including all operations, nightly backups, security, and hardware. Speaking of which:

Hardware Costs

This varies greatly based on your data size, I/O, CPU and RAM requirements, which can also drive replication and sharding, and so on. With all of the variables, how can we quantify a cost? Let’s keep things simple with a couple fixed examples: smaller and larger.

The smallest and cheapest plan you’d probably have is a single small cloud server. With 1 year signup, a small AWS EC2 reserved instance (1.7 GB RAM) plus, say, 5 GB EBS storage will cost you about $45 a month. A similar MongoHQ hosted plan will cost you $49 a month with no yearly commitment. If even that’s too rich for your blood, we have an even smaller plan for $15 a month–a deal you’d be hard pressed to replicate on the cheapest virtual host.

A bigger setup might be six quadruple extra large servers (two shards and a config, with two replset servers for each). These heavy utilization servers will cost you $6,400 each for a 1 year term ($38,400 for all six), plus around $2025 per month usage costs–or $5225 total a month.

Let’s ponder this: is it worth getting the quads, or should you get doubles for half price if you use EBS, since you still have to deal with the EBS I/O constraint anyway? Or should you just buy your own dedicated, bare metal hardware? If so, where do you host that relative to your application to reduce I/O rates and costs? Those are all questions worth asking… the kind we happen to be equipped to answer. A hosted solution can actually save you money on hardware costs–because when you manage nearly 20,000 database installs, we get pretty good at right-sizing.

If that’s not a persuasive cost-saving argument–consider that hosted solutions like MongoHQ also leverage economies of scale by providing similar (virtual) hardware to thousands of clients. In other words: our environment providers like us very much.

Other costs

MongoDB is open source, so licensing costs equal zero, correct? Yes, for the bare-bones MongoDB software. However, periphery software, like monitoring services, stats tools, web interfaces… these all have associated licensing and service costs from free, to thousands of dollars each. What about SLAs? Open source software doesn’t exactly provide one.

MongoHQ can wrap all these up in one monthly price; along with free extras you won’t get by self-hosting, like a powerful REST API for database and invoice management, and relevant DB/server statistics.

Finally, you need some support. Of course, your $10,000 a month operations person can resove many issues–but sometimes even she can reach a dead-end. For the server environment, this often requires a support tier with access to the details of the underlying hardware (in AWS this can cost thousands of dollars for this kind of access, or pay-per support in dedicated hardware). Hosted solutions generally buy support in bulk, and thus can recieve high-level deals and priorities that smaller operations cannot. And don’t forget about MongoDB’s commerical support through 10gen (the company that created MongoDB).

Totals

When taken as a whole, supporting one’s own database can be an expensive proposition. Ignoring the improved reliability, security and simplicity of leveraging a dedicated and experienced team, using a hosted Mongo solution can actually save labor, hardware, licensing, service, support, and other costs. We also provide all this with a single monthly payment. Oh, you also get to sleep at night while we fix things… but that’s a post for another day.

This post was written by Eric Redmond.