mongoDB atlas scaling with AWS regions

0

I have 6 EC2 Instances on different region on AWS. I have only one MongoDB server on MongoDB Atlas (AWS). I am having latency issue while updating Data to the database. what is the best way to scale my MongoDB server with My 6 EC2 instances.

已提问 5 年前594 查看次数
2 回答
0

You can try one way you can apply the VPC peering from EC2 to MongoDB Atlas (AWS). As MongoDB Atlas as now VPC peering function.

If you are trying to connect the MongoDB using public-facing network, then it might be slow.

AWS launched instances in a different region may create a connection using inter-region cross VPC peering.

So if you are following tradition way to whitelisting ACL's better try this it will reduce latency issue.please peer all the region's VPC (make sure there will not be any IP conflict) and try to connect using private connections.

EDIT : 1

There is no additional penalty with MongoDB in terms of using it out of region, but most database protocols are not optimized for high latency conditions. You might be much better off setting up a read replica in other regions.

You can read this: https://www.mongodb.com/blog/post/optimizing-fast-responsive-reads-cross-region-replication-mongodb-atlas

EDIT : 2

If you can't push your database to multiple regions (by using read replicas for example), then you should consider using CloudFront in front of your application(website) to allow for caching of requests in the different regions.

It won't technically improve the latency between application and database, but in terms of your user's perception of performance, it will be little speedy.

已回答 5 年前
0

Here's a secure and cost-effective way you can connect to your MongoDB cluster using AWS IAM passwordless authentication. I think it is one of the fastest ways to connect to the DB as well.

Link: https://vishnusblog.tech/secure-mongodb-with-aws-iam-passwordless-authentication-example

You could create a global EC2 role and assign it to all of your instances. Use that role to enable authentication with reference to the article mentioned.

已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则