Connecting to a Atlas DB from different AWS regions

Requirement is that an application instance deployed across multiple AWS regions needs connectivity/access to the same DB. Does MongoDB Atlas support multiple Private endpoints to VPCs in different AWS regions where the application is deployed?

Hi @Sudhir_Harikant,

Requirement is that an application instance deployed across multiple AWS regions needs connectivity/access to the same DB.

Could you provide following details on your Atlas environment regarding this question:

  1. Is the cluster a Replica Set or Sharded Cluster
  2. Is the cluster single region or multi-region

Additionally, could you briefly describe the AWS application infrastructure? As an example:

  • VPC1, Region A - Application Instance 1
  • VPC2, Region B - Application Instance 2
  • VPC3, Region C - Application Instance 3

Regards,
Jason

Hi @Jason_Tran ,

We are still trying to evaluate the best fit for this requirement. Can we sharded cluster deployed in a multi-region AWS environment and have private link connections to application instance running in each region? Will this provide HA in case one region is unavailable?

This is right, the instances deployed across multiple regions belong to same application and hence need communication to a single DB

  • VPC1, Region A - Application Instance 1
  • VPC2, Region B - Application Instance 2
  • VPC3, Region C - Application Instance 3

hi @Jason_Tran,

Could you guide me on the suitable deployment type?

Regards,
Sudhir

Hi Sudhir,

I wouldn’t be able to advise a “best fit” for your organization regarding the private endndpoint connectivity as there are many factors that would affect this. In saying so, If it’s a replica set multi-region cluster, you’ll need to ensure AWS PrivateLink must be active in all regions into which you deploy a multi-region cluster.

This is right, the instances deployed across multiple regions belong to same application and hence need communication to a single DB

  • VPC1, Region A - Application Instance 1
  • VPC2, Region B - Application Instance 2
  • VPC3, Region C - Application Instance 3

For replica sets, based off a quick glance at the application instances and assuming you have a single cluster (single region cluster), you would need set up Same Region private endpoint <—> Same Region application instance private link and have your other region applications have peering to the “Same Region” application VPC to use the VPC endpoint which connects to the Atlas cluster:

To connect to Atlas database deployments using AWS PrivateLink from regions in which you haven’t deployed a private endpoint connection, you must peer VPCs in those regions to VPCs in a region in which you have deployed a private endpoint connection.

For a sharded cluster I would go over the (Optional) Regionalized Private Endpoints for Multi-Region Sharded Clusters documentation.

However, you may wish to confirm with the Atlas support team via the in-app chat if you have any further queries regarding private endpoint connectivity.

Lastly, the following documentation may be of use to you to go over: Private Endpoints - Limitations

Regards,
Jason