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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南