I am looking into a setup where I will have servers and databases in multiple regions (data not replicated across region but independent).
The ideal flow would be:
- user make a request to api.domain.com
- proxy/load balancer determines which location contains the user data / user related data (ideally cache this against the user's session)
- proxy routes the request to location1.api.domain.com
- ideally the location1.api.domain.com will be load balanced through this service too, or independently (AWS Beanstalk for example)
I am looking at HAProxy which seems to support custom routing but do you have any tips around a setup like this or some articles/examples of custom routing? If that's a good solution for this at all.
Related question advising to use HAProxy: How to configure reverse proxy/loadbalancer for custom routing