Last time we covered how to create a basic development environment in AWS. One extra feature you are probably going to want for your new server is a floating IP Address. To put it simply, a floating IP address is a set IP address that you can move around from one server to another. Whichever server the IP address is attached to then acts for all intents and purposes as if the floating IP address is the IP address of that server. To avoid getting too far into complexities here we are going to assume that your site is just on a single server (though floating IP addresses are very useful more complex setups too).
So now lets get to the reasons:
1. You can change servers much more quickly
Whenever you change the IP address that you attach to a domain you need to wait for the new address to propagate. Whilst this is usually very quick, it’s not instant, and in fact issues like your browser caching the old IP address can mean that this takes longer. Attaching a new IP address really is instant, and you don’t have to worry at all about caching either. This can be worth the hassle alone even for basic setups.
2. They make scaling your site easier
The flexibility of using a a floating IP address also pays dividends. Yes you can (depending on your hosting provider) normally scale up servers without having the IP address change, but there will be some downtime whilst the server is being upgraded. With a floating IP you can instead spin up a new larger (or smaller) server and then gracefully transfer over once everything is good and ready. Ultimately, if you are lucky (or unlucky) enough to need to scale your application more significantly then just by buying a faster server you can instead attach the floating IP to the load balancer which co-ordinates your new setup.
3. Sometimes default IP addresses can change
Your IP address is taken from a pool of available IPs, and there are situations where it will be returned to this pool and your server will be given a new IP address. For example, the EC2 instance we built last time will be given a new IP address every time it gets terminated when you log out. This means if you started pointing your dev server at the IP address of the instance and then came back later on, you would have to change the DNS settings to point at the new IP.
4. They allow you to recover your site a lot easier (or even automatically)
Another great use for floating IP addresses is fixing a broken site. If the instance set up with your floating IP address starts to get into trouble, you can just transfer the IP address to a fresh new server. This can even be automated, so that in the event of a problem a new server is provisioned and put online without you having to do anything.
So those are some of the advantages of floating IP addresses for simple server setups. It’s worth checking if your hosting provider supports floating IPs as not all do, and the best time to start using one is right at the beginning of making your site. Hopefully we have demonstrated why it’s worth the trouble.