Different databases in different regions

Our application has data sovereignty requirements (US data stores in the US, U.K. in the U.K. and AU/NZ in AU). I was thinking of running the application in three regions with respective databases in each.

How would you select the correct database for each region?

Can I set a differ env var per region or is there an env var for which region the app is running in?

You can specify the region via DNS: “ams.yourapp.internal”. You also have FLY_REGION in your application environment. Something like ${ENV['FLY_REGION']}.yourapp.internal should work.

Thanks, will test it out.