Adding a failover group

A failover group is a managed quick response DNS address that automatically follows your application web endpoints. You can connect it to up to 2 applications at any time - a primary and backup application. Should you need to switch traffic between your stacks, simply flip the switch and your traffic will flow to the backup application within 5 minutes.

There are two major use cases for this:

Failover groups follows the web head of your application. In other words, it points to your web server when you don’t have a load balancer, and if you have one, at your load balancer. Failover groups will also automatically update to point at a newly added load balancer. Similarly, it also gets automatically updated when you rename your application or web servers.

A great way to test this is to use the dig command in your terminal, for example dig, which allows you to see where the DNS is pointing.

Add a failover group

To view your failover groups, click the Failover Groups link on your Dashboard page. To add a new failover group, click the + button:

You are then be able to select a Primary and a Backup application for your failover group. Once you have a failover group, add a CNAME record in your DNS provider dashboard that points at the address provided.


Environment variables

There is an environment variable called FAILOVER_STATUS with three different values: online, offline and none which means the traffic goes to this stack, does not go to this application or this application is not part of any failover groups, respectively.

You may have some jobs configured on both like sending an email, but you need them to be run only on the online one you can use this environment variable to prevent duplication.