简体   繁体   中英

How can i route users to a specific region using aws?

Some apps, such as Discord, offer users the ability to set the server region themselves. In my app, users should be able to do the same. When they create a team, they can decide which region their team data will be stored in.

Tech Stack

Right now, I'm using the following technologies for my application:

  • Blitzjs (Nextjs with some cool extra features)
  • Postgresql with Prisma TypeORM
  • Blitzjs API Routes for using aws-sdk

Data center

to allow users to choose their own server region, I wanted to use AWS. However, I'm still a beginner when it comes to AWS, so I don't know which services are best to use in this case. So far, my plan has been to use Elastic Beanstalk to deploy my app to aws. But how can I make sure that user requests are forwarded to the server region that was previously set during team creation?

Each user can also be part of multiple teams. This means that every time a user changes teams, I may have to reset the server region or routing based on which server region was set when the team was created. How can I implement something like this?

Route 53?

Route 53 is a global DNS service. You can set it to automatically forward requests to the server region closest to the user. Could I implement this service for my project, or would this not be technically possible, since the routing depends on the specified team region and not on which region is closest to the user.

You can use Route53 and use Geolocation routing policy, so that you can direct the user requests originating from a region to a specified region where the data will be stored. But this means that you will have to deploy your resources in multiple regions. You will also have to use ELB for this to work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM