Situation:
I am working on the deployment of a Software, a Web Application (HTTPS/REST), which should be highly available. Simply said, I bought one server in one data center (DC1) and one server in another data center (DC2).
DC1 replicates to DC2 and I have one hot spare at any time (N+N Redundancy). In general, all Traffic should go to DC1, but if DC1 goes down, all traffic should be routed to DC2. Maintenance might also be reason for routing to DC2.
I have faced a problem when using DNS (Multiple A Records) as a solution as most Browser will actually route to DC2, but only after a 30 seconds timeout.
Question:
Which Product from GCP, if any, should I use to achieve this kind of task and especially how do I make it work with my on premise servers? (I have taken interest in Traffic Director but it seems to be restricted to Cloud VM Instances) Should I go a completely different way and solve this by automatically adding/removing DNS records?
I would like to go with something on a hosted serer or from GCP as it's already negotiated.
Greetings and all help is very much appreciated
Alex
For everyone coming across this question. I have used Cloudflare as my DNS, which proxies all my connections. Because of that, DNS edits, which change the target, are instant as Cloudflare simply reroutes internally. So I have used their API to change DNS records. I have a script on each server, which checks if the mirror server is still up and if not changes the DNS record.
The switch happens so fast, that connections don't even timeout and I am pretty happy with this solution. if anyone would like my script, simply let me know and I'll publish it on my Github.