I'd like to deploy a web application in a robust manner.
The application itself is written using Elixir, which runs on top of Erlang/OTP, meaning that the application can be deployed on different nodes which can internally manage failover/takeover when one of them goes down for some reason.
However, DNS is not built for this: Adding multiple A-records does not mean that clients will try one of the other servers when the one they try to connect to does not respond in time.
A lot of people then give as answer 'use a load balancer', which is nice, but then the load balancer itself becomes a single-point-of-failure.
Luckily, I was pointed to the Border Gateway Protocol, which (if I understood it correctly) allows multiple servers to listen to the same IP-address, and could therefore maybe function as an alternative. I have no idea (yet) how BGP works internally though, and also not if you need dedicated hardware if you want to use it or not.
So what I'd like to do is to:
- During normal usage, traffic should be split between the two servers roughly equally.
- When one of the servers goes down, the other should take over all the traffic.
It would be wonderful if the servers could be configured while they are in a somewhat distant geographical location (i.e. not in the same building) to make sure that e.g. local power failures do not shut off both servers at the same time. I do realize that both Erlang/OTP and BGP require some geographical proximity, because network latency needs to be low enough for these technologies to properly work.
So my questions:
- Is this possible? If so, how?
- Do you need dedicated hardware (like special routers) to make this work, or could this also work in a context where the two servers would be VPSes (Virtual Private Servers) of different providers (in geographical proximity)?