Public cloud IaaS providers such as Amazon Web Services (AWS) offer enterprise grade infrastructure to run new age, distributed scale out databases such as MongoDB. While AWS can be cost effective for small deployments, rental costs can become quite expensive for production scale deployments especially for a cost conscious organization. In the case of MongoDB, most of the I/O is random. Therefore, if your working set is much larger than memory, with random access patterns you may need many thousands of IOPS from your storage layer to satisfy demand. AWS offers two broad choices for customers: Amazon Elastic Block Store (EBS) and Amazon EC2 instance store.

An Amazon AMI (Amazon Machine Image) for MongoDB can be provisioned to deliver up to 4,000 IOPS per EBS volume, but there can be very high recurring monthly costs associated with this option.  An instance store, on the other hand, provides temporary block-level storage, which depicts very good random I/O property like flash and comes free with most of the latest Amazon instance types. The  instance store can be efficiently leveraged for I/O optimization to provide a better user experience, especially for data that is replicated across a fleet of instances, such as a MongoDB shared cluster.

Figure 2 AWS SB

Figure 2 above depicts a lab experiment comparing the performance and TCO of a MongoDB based AMI versus a MongoDB AWS deployment optimized with PrimaryIO APA. In this use case, MongoDB is used to run analytics on a web server log repository to get answers for various business intelligence questions. The data load phase includes importing the data into the MongoDB database while the run phase includes running analytics on the job on the latest inserted data set.

The results show that the PrimaryIO APA technology for MongoDB improved TPS of the load phase by 38{00650960c7c98e0cfb19b413dfe1b11628fd22333dea5da8eda402d86148a18a} and latency by 27{00650960c7c98e0cfb19b413dfe1b11628fd22333dea5da8eda402d86148a18a}, as well as the run phase TPS by 15{00650960c7c98e0cfb19b413dfe1b11628fd22333dea5da8eda402d86148a18a} and latency by 12{00650960c7c98e0cfb19b413dfe1b11628fd22333dea5da8eda402d86148a18a}. What is even more compelling is that the PrimaryIO solution was able to reduce the monthly rental cost per node by 45{00650960c7c98e0cfb19b413dfe1b11628fd22333dea5da8eda402d86148a18a} through more intelligent and efficient utilization of the EC2 flash instance stores vs. relying entirely on the much more costly Amazon AMI for MongoDB provisioned to deliver up to 4,000 IOPS per EBS volume.