Thank you for your suggestion.
It should be noted that implementing redundancy in the program itself is far more complex than simply using a DNS naming for that purpose. Just use a DNS name for your server (instead of an IP address) and keep another server ready. If your first server fails just update your DNS record and point it at the other server's IP address. Nowadays DNS propagation literally takes minutes if not seconds and your remote traffic will be rerouted through the second server in no time. This sounds like a cheap solution but it works.
Let me know if you have other questions.