Implementing Mongo and Docker

Today I spent the morning comparing the economic feasibility of using DynamoDB vs. MongoDB for our project. I wanted to be very thorough just in case using our preferred technology (MongoDB) would be too expensive. After carefully looking at three cost categories for each technology (compute cost, bandwidth cost, and storage cost), it turns out MongoDB wins in each of them. Here’s a breakdown of the cost we could expect for our particular use case. For confidentiality reasons, I won’t reveal the details for the number of hits Engineering.com expects per month according to their last year of logs, but we used that “number of hits per month” number along with the number of transactions per hit we expect (where a transaction is an ajax query our code will fire against our back end) to come up with these numbers:

DynamoDB:

Per month as of the 13th running month:

Compute: $0 *They don’t charge for compute time just to take in data
Transfer: $21.67 *They charge $0.0065 per 10 “units” where a unit is one 1 KB transaction per second
Storage: $343.32 *They charge $0.25 per GB per month

Cumulative after 12 months of running: $2,491.60

MongoDB on Elastic Compute Cloud (EC2) with Elastic Block Storage (EBS)

Per month as of the 13th running month:

Compute: $18.99 *They charge $0.026 per hour for the t2.small instances
Transfer: $0 *They don’t charge for data coming into your web app
Storage: $137.33 *They charge $0.10 per GB per month

Cumulative after 12 months of running: $1,120.56 // winner

If you haven’t noticed by now, MongoDB having such a low price per GB stored each month is going to make it excellent for our application. And that’s exactly what the results of my analysis show. We’re definitely going to want to go with MongoDB for this. It will be open source, making it extensible and free for Engineering.com in the future, and it’s cheaper. Maybe they can give me and my team mate bonuses!

if (they.likeUs()) {
ourSalary++;
}

Maybe.

The rest of our day was spent switching the first version of the back end API that we made weeks ago to complete the route actions by talking to MongoDB and getting it “Dockerized”. My team mate worked on that while I continued to look into the logistics of using MongoDB on AWS. It turns out it’s a heavily studied subject. I was able to find some very useful resources on combining these two technologies:

https://www.mongodb.com/blog/post/selecting-aws-storage-for-mongodb-deployments-ephemeral-vs-ebs

https://www.mongodb.com/collateral/mongodb-on-aws-guidelines-and-best-practices?jmp=blog?jmp=hero

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s