Question

Multiple High Availability between datacenters

Hey guys,

I’m learning the ropes for high availability ops work. I have requirements that my HA setup also be capable of failing over to different data centers (or simply include more than one datacenter actively at once). Does this sound like a reasonable setup for what I’m trying to accomplish?

  1. Create high availability setups in two different data centers. This likely includes 2 load balancers, web servers, and a database server in each physical location.

  2. Use DNS round robin to distribute traffic to both data centers, using floating ips pointed at the primary load balancer of each data center. If one data center goes down entirely, remove that DNS record to route traffic to the other datacenter (albeit with a small delay due to TTLs).

Questions about the above:

  • In terms of database replication between data centers, I presume I’ll need to use master master replication? In this scenario, are there suggested best practices for connecting to the databases for replication since I cannot utilize private networking features?

  • I understand that DNS round robin is essentially random. Is there a better way to use DNS to smartly send traffic to the correct datacenter based on geographical location of the user?

Thanks!


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

In terms of database replication between data centers, I presume I’ll need to use master master replication? In this scenario, are there suggested best practices for connecting to the databases for replication since I cannot utilize private networking features?

You can tunnel your MySQL replication over SSH which gets around the security issues with using the public network.

I understand that DNS round robin is essentially random. Is there a better way to use DNS to smartly send traffic to the correct datacenter based on geographical location of the user?

Nothing that I’ve personally encountered. When running your own DNS services it might be possible to do things much more actively at the DNS level.

For your failover configuration this guide might also be helpful. It outlines how to use heartbeat to do auto-failover of a floating IP. The same methods might be able to be used to determine if one of the data centers becomes un-reachable to your app.