Is AWS's Elastic Load Balancer a single point of failure?
I am looking at moving our application up to Amazon Web Services. The plan is to have all of the EC2 instances mirrored across two availability zones. Due to data transfer costs, we will be staying in a single AWS region (Oregon).
The multiple AZs get rid of the single point of failure for our application and database servers, but what about the ELB? If I have a single ELB distributing traffic across two AZs, is the ELB also hosted across those two AZs?
What does Amazon do to prevent the ELB from being a SPoF?
Solution 1:
At its heart, an ELB is just a collection of EC2 instances. When you create an ELB, you specify the availability zones you want that load balancer to be in. Instances to make up the load balancer will then be created in those zones. The way they avoid a single point of failure here is by returning multiple IP addresses when you do a DNS lookup. For example:
- DNS lookup for website.example.com returns CNAME website-elb-12345.eu-west-1.elb.amazonaws.com
- The lookup also returns the information for website-elb-12345.eu-west-1.elb.amazonaws.com. It states that the site has IP address 1.2.3.4 and IP address 2.3.4.5
It is up to the client to choose which IP address to use to make a connection. The IP addresses won't always be returned in the same order from the DNS lookup. A client could retry on an alternative IP address if they can't connect on the first attempt.
The TTL on the DNS records for an ELB is only 60 seconds which means that should an ELB instance die and get replaced, the DNS will be updated everywhere fairly quickly.
Solution 2:
It actually could be a SPoF but I believe it would be a SPoF only within the same region.
That's why AWS is suggesting to use Route 53 health checking in order to detect and re-route traffic that would end up on a unhealthy ELB.
You can use Amazon Route 53 health checking and DNS failover features to enhance the availability of the applications running behind Elastic Load Balancers. Route 53 will fail away from a load balancer if there are no healthy EC2 instances registered with the load balancer or if the load balancer itself is unhealthy.
Source: http://aws.amazon.com/elasticloadbalancing/
Solution 3:
You can get around your single AZ SPoF by creating an autoscaling group where if your single ELB does not meet X factor, whether it is by load, response time, etc., a new ELB is created. ELBs are essentially EC2 instances running proprietary AWS code.