Load balancer vs dns vs floating ip

Hello, Currently I have the following setup: My domain is pointed to the floating ip, that point on one of the two loadbalancer that point on one of the two apache server. The reason it was done like this is that we need to never have a single point of faillure. But is it a little bit overkill, and what is the point of all the parts?

I means, if on godaddy, I setup the dns to send all @ to both apache server ip, will it have the same result?

Or if I make the dns to send all to the loadbalancer?

Or maybe skip the loadbalancer and point the floating ip directly to the apache server?

What would be the best setup to be sure to never have any downtime? Thank you

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.

You have to think of it as complexity vs benefit. Of course it would be great if every request was processed without ever failing, however, the complexity of doing this doesn’t increase linearly, but instead increases much more sharply.

So you really have to ask yourself, are you running an application that can’t suffer even a single second of downtime? If you are a bank handling transactions, probably a good idea to never even have a second. If you are running a public website and you have second of downtime, it probably won’t affect your business much.

Remember that to create a setup that is truly resiliant you are adding numerous complex components, the more components you add the more likely that any one of them has an issue. Additionally you are now routing requests over several layers so trouble shooting becomes more complicated.

Now all of that aside you asked the question of the difference between floating IPs, DNS, and load balancing.

If you add multiple DNS entries for a domain or subdomain then they the DNS server will randomize the responses and send traffic to the listed IP addresses. This doesn’t give you failover protection, but it does provide an easy way to build horizontal scaling, and also if you do experience an issue instead of all of your traffic being lost, you will only lose a percentage. Say 33% if one of three servers fails.

Floating IPs are basically a network configuration where an IP can switch between two servers almost instantaneously. This provides failover and especially if you just have two servers running, one in active, one in passive mode. The problem is that you need to run a service on both servers that are constantly monitoring each other so that they can pass the IP back and forth. It adds fail over protection, but it also creates a potential point of failure.

Load balancing is really doing two things. One is that it can be used to create failover protection, but it’s also necessary if a single server can’t handle all of your requests. This way you can load balance between multiple servers.

However, again you have another point of failure, which is why people setup load balancers in pairs so that if one fails the other one takes over.

The setup with most failover protection would be a floating IP that resides between two load balancers in an active / passive configuration which are then sending traffic back to your actual webservers.

So you went from one web server to a total of 5 servers pretty quickly, and each one adds a point of failure and you are relying on software to mitigate that.

There are also no services which will be fool proof always and remember the more failover protection you add the more complex the management of your configuration becomes.

So with that in mind you may want to use a Load Balancer from DigitalOcean as that provides you with a pair of load balancers with a floating IP between them and then you can tell it which backend servers to route requests to.