Hey @kitar, thanks for this write up. How's it going one year later? Do you use a relational database? Do you have a dedicated db instance in each region? Thanks!
Vapor - Multi region active-active setup
Hello Artisans,
I’ve tried some multi-region active-active setup with Vapor. It looks working fine, but I’m not sure this is a good idea or not. What do guys think?
Little background
I’m now planning to rebuild my SaaS with Vapor and DynamoDB (Global Table) to support global users. It’s okay to make separate endpoints per region, but it’s more joyful if I can serve with a single URL.
Approach 1 (failed)
I tried to use Route 53’s latency based routing to point API Gateway, but according to this article, it says API Gateway must be regional to use like that. (Vapor deploy edge-optimized version) https://aws.amazon.com/jp/blogs/compute/building-a-multi-region-serverless-application-with-amazon-api-gateway-and-aws-lambda/
I think this is not good because it needed too many manual modifications.
Approach 2 (looks good)
Use Load Balancer and Global Accelerator. Working fine but there’s still little manual modifications:
- ALB: Activate Global Accelerator
- ALB: Modify the Listener’s Rule to accept one more (shared) domain
- Route 53: Add A (or CNAME) record
It’s just a few clicks. Vapor brings us a multi-region active-active serverless setup with just a few additional clicks. However, because I’m still changing things manually, I’m not sure this is fine or bad for Vapor.
Please or to participate in this conversation.