I am running a site using AWS and MongoDB, and I would like to know how to change the MongoDB region and what precautions should I take. Currently, AWS is in Seoul and MongoDB is in Virginia. I would like to change the MongoDB region to Seoul.
One of the coolest things about MongoDB Atlas is the fact that you can change the deployment region (or even the cloud provider) at any time, and MongoDB Atlas will move your cluster in a rolling manner while preserving availability (uptime). All you need to do is change the region in the cluster editor and deploy.
Assuming you need to actively connect, read, and write during the transition, the thing to be mindful of is ensuring that your application tier can reach your Atlas cluster, preferably in both regions during the transition, over the network. Private Endpoints and VPC Peering are regionally set so you’ll want to ensure you can reach the Atlas cluster from the new region too. This is easier to do with a sharded cluster where mongos’s are the connection point. For replica sets: you will want to ensure you can reach both regions during the transition period since the primary will move from the old to the new region. Note that you could consider using public IP level access even if temporarily during the transition as an alternative option.