The Strategy Behind Migrating MongoDB to the Cloud

By | In Blog, MongoDB | October 12th, 2017

MongoDB is a perfect candidate for a cloud migration because it’s designed to act as a distributed database system. It’s already optimized for the cloud, so you can seamlessly incorporate it into a hybrid or public configuration. You have three main ways to move MongoDB to the cloud.

AWS Database Migration Service

The AWS Database Migration Service, known as DMS, has extended functionality that supports NoSQL database migration to the Amazon Cloud. When you use this service, you can migrate relational databases, data warehouses and analytics applications. You can use MongoDB as a migration source, with Amazon DynamoDB as the target database. Another option is using MongoDB Atlas to deploy MongoDB databases on Amazon EC2.

AWS DMS has two migration options if you want to use MongoDB as the source. The document mode is an as-is migration. The JSON data migrates as a single column table named “_doc.” Table mode transforms MongoDB documents to a data row in the table. Each top-level field is transformed into a column.

Adding AWS MongoDB Server as a Replica Set Member

No downtime is required when you use this method for your MongoDB migration strategy. The first step is to create a backup or mongodump of the database so you can roll back without any issue if necessary. In the second step, you perform a connectivity check that verifies the network configuration. This test makes sure the network allows connectivity for each possible connection between the members.

Next, you switch to AWS and empty the data directory. Start MongoDB with the same configuration as the on-premises version of the same database. Now you can add the AWS server into your own data center replicate set with RS. The initial sync should run and complete. Once it does so, you can remove the on-premises MongoDB and swap in the AWS one. This method does not cause any downtime in ideal circumstances.

Backup and Restore to AWS

The final migration strategy uses a backup or mongodump of your on-premises database. You install and configure a brand-new MongoDB on AWS. At this point, you restore the database to AWS. Then you direct your application to AWS. This method requires downtime.

With AWS Data Migration Service now supporting NoSQL database migration, it makes sense to take your MongoDB databases into the cloud. You can move your existing database applications to AWS and take advantage of the distributed infrastructure and scalable capacity.

Leverage a Managed Services Provider for Your MongoDB Migration

You may not have the in-house resources to support a MongoDB migration. Managed services providers such as Datavail help you prevent service disruption and create a smooth transition. We not only help you with the implementation process, but we can also assist with the planning stages. Each MongoDB migration strategy has its strengths and weaknesses, and we will match you to the option that helps your business get the best performance and availability for your needs.

Leverage our expertise in database migration so you can guarantee a good result for your project. We have hundreds of MongoDB migrations under our belt and know the methods to speed up the process and optimize all the resources invested in the move.

Do you want to learn more about migrating MongoDB to the cloud? Download our white paper, “Moving MongoDB From On-Premises Data Center to AWS — A Practical Primer.”

Contact Us
Esayas Aloto
Senior MongoDB Professional, RM MySQL
Esayas is MongoDB Certified Associate DBA with experience administering MongoDB, an open-source document database and the leading NoSQL database. Prior to working with MongoDB Esayas worked with Microsoft SQL Server and Oracle. Esayas has extensive experience on installation, configuration, backup, recovery, performance tuning, capacity planning, security, upgrades, maintenance, monitoring, replica set configuration, sharding, and design of large scale databases. Esayas Aloto also has MBA from University of Northern Virginia.

Leave a Reply

Your email address will not be published.
Required fields are marked (*).