Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kitar's avatar
Level 5

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.

0 likes
2 replies
bytelaunch's avatar

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!

kitar's avatar
Level 5

Hi, thanks for your reply! Currently, I'm using a relational database (and dedicated instances for each region) for most production apps.

However, I'm still dreaming of using DynamoDB as a primary database for apps that don't need relational databases. (eg. I wrote this library to implement Authenticable for DynamoDB: https://github.com/kitar/laravel-dynamodb)

Please or to participate in this conversation.