Migration from MongoDB to Amazon DocumentDB: Online
This architecture shows how to migrate from MongoDB to Amazon DocumentDB using the online approach with AWS Database Migration Service (AWS DMS). This approach delivers near-zero downtime with medium complexity.
Migration from MongoDB to Amazon DocumentDB: Online Approach
The following steps describe the architecture:
-
When you use the online method to migrate to Amazon DocumentDB, your application continues to write to the source MongoDB database.
-
Create an Amazon EC2 instance in the same VPC as your Amazon DocumentDB cluster and install the mongo shell. Establish connectivity from the Amazon EC2 instance to your MongoDB source, then export the data indexes to the Amazon EC2 migration instance using the mongodump tool.
-
AWS DMS enables database migration using full data load and change data capture (CDC). The online migration approach uses AWS DMS to perform a full data copy and uses CDC to replicate delta changes to Amazon DocumentDB. To improve the performance of AWS DMS full data load migrations, use the auto segmentation or range segmentation option.
-
Use the Amazon EC2 instance created in step 2 to connect to the Amazon DocumentDB cluster to migrate indexes. Use the Amazon DocumentDB Index Tool to check the dumped indexes for compatibility, and pre-create the indexes on the target Amazon DocumentDB cluster.
-
When the data is in sync, switch your application's database connection string to use the new target Amazon DocumentDB cluster.