MongoDB, like other NoSQL databases that support JSON-styled, document-oriented storage systems, offers scalability and flexibility that complex applications today require. As such, running MongoDB can be a great enabler for your AWS big data workloads.
But how exactly are you going to run MongoDB on AWS?
This post will introduce you to the two major deployment options for MongoDB on AWS: using a managed service or managing it yourself based on Amazon EC2 instances.
Read on to find out about:
As a NoSQL database, MongoDB addresses the scalability needs of modern data applications. That’s because unlike traditional databases, MongoDB typically stores a collection of schema-less data which gives developers the flexibility they need to map out different data types without a database administrator’s help. It’s a DevOps-focused database.
Some of the common use cases for MongoDB include:
Whether you’re already using AWS and looking to adopt MongoDB or if you want to migrate an existing MongoDB database to the cloud, the good news is that AWS and MongoDB can combine to offer the best of both services. When you combine MongoDB with cloud services like AWS, the benefits include increased speed and massive economies of scale.
Using MongoDB on AWS will really depend on which deployment option you decide on for the database. There are two ways to use MongoDB on AWS:
For the rest of this post, we’ll explore the pros and cons of the two deployment options and how to migrate your existing MongoDB cluster to AWS.
In the managed deployment option, the responsibility of maintaining and scaling the database is abstracted away from you. You pay for what you use with less operational burden. For this managed service option, you can either use MongoDB on AWS through Amazon DocumentDB, the native-AWS managed service, or use MongoDB Atlas, which is a third-party managed option.
Amazon offers Amazon DocumentDB, a MongoDB-compatible and fully managed database service that is fast, scalable, and highly available. MongoDB’s source code is not shared or used by Amazon DocumentDB. However, it began as a clone of MongoDB version 3.6, which Amazon rebuilt as a closed-source to address scalability pain points from customers.
A decision to use Amazon DocumentDB comes down to availability, scalability, data protection, manageability, automation, and low maintenance.
While Amazon DocumentDB is a compatible service for use with MongoDB and MongoDB workloads, Amazon DocumentDB is not the same as MongoDB. The major difference is that DocumentDB is a managed service. There are also key differences and a few limitations to using DocumentDB, which we’ll detail below.
There is another option for running MongoDB as a managed service outside of AWS. MongoDB Atlas is the Database-as-a-Service (DBaaS) platform built by the same team that created MongoDB. It has all the features of MongoDB with the benefits of being fully managed.
MongoDB Atlas offers users a managed, pay-as-you-go pricing model with the ability to deploy on any cloud service provider of their choice, AWS included. It provides an automated patching and one-click upgrade from high availability to scalability and security to disaster recovery. Its sharding feature allows users to scale beyond a single server’s limits and across a range of instances with zero application downtime.
The other option for running Mongo DB on AWS is to self-manage the database built on AWS components.
The self-managed deployment option is a do-it-all approach. With this option, you’re going to be in charge of how the database is managed. You install it, you configure the settings to match your requirements, and you maintain the cluster.
MongoDB can be installed on Amazon EC2 or deployed using the AWS Marketplace. First, you will need to get your deployment planning and set up the single production node. This will be followed up with setting up a place for storage before getting your MongoDB instance running. You could also scale your deployment on a multi-node replica or a shared cluster.
Different applications have different needs. Sometimes, an application’s need might push you to a self-managed option. So, it’s worth considering its pros and cons.
You may already have your database cluster in-house or in another data center. To take advantage of AWS Cloud, you may consider migrating your MongoDB database to AWS. The following section will detail the approaches to MongoDB migration on AWS.
You can use AWS Database Migration Service (AWS DMS) to migrate data from on-premises, on an Amazon Relational Database Service (RDS), or Amazon Elastic Compute Cloud (EC2) to Amazon DocumentDB with virtually no downtime.
Mongodump and Mongostore allow you to dump and restore data from MongoDB databases in a binary format while migrating data to Amazon DocumentDB. This tends to yield a smaller data size than logical exports and incurs downtime for your cluster.
There is a way to combine the benefits of managed and self-managed options to get the best of both worlds. The way to do that is with Cloud Volumes ONTAP.
Cloud Volumes ONTAP is an enterprise-class data management platform for AWS as well as Azure and Google Cloud.
Cloud Volumes ONTAP enables its users to scale their applications quickly without compromising performance. Using it as a data management layer on top of your EC2-based MongoDB, lets you avoid losing full control and risking getting locked to a vendor that comes with a managed service.
Cloud Volumes ONTAP gives you the ability to run MongoDB:
At the same time, you’re getting more features than either the managed services or the infrastructure-as-a-service (IaaS) model can provide:
MongoDB can be run as a service, or you can run it the way you want to. With Cloud Volumes ONTAP, you can get a solution to provide the best of both, and much more.