I'm working my way through a practice exam for an AWS certification. One of the questions is as follows:

 The web tier for an a pplication is running on 6 EC2 instances spread
 across 2 AZs behind a classic ELB.  The data tier is a MySQL database
 running on an EC2 instance.  What changes will increase the
 availability of the application? (select TWO)

 A: Turn on CloudTrail in the AWs account
 B: Migrate the MySQL database to a Multi-AZ RDS MySQL database instance
 C: Turn on cross-zone load balancing on the ELB
 D: Launch the web tier EC2 instances in an Auto Scaling Group
 E: Increase the instance size of the web tier EC2 instance

Correct answers are B and D. My question is, why is C NOT a correct answer? The instructor (an Amazon employee) glosses over C, explaining that "enabling cross-zone load balancing would have little to no effect on availability." But the way I'm looking at it, if the ELB can't send traffic to both AZ's, then we're effectively making our 6-instance system into a 3-instance system (assuming there are 3 in each AZ). And a single AZ system is never the considered a highly available architecture, since if that one AZ fails, your whole system is unavailable.

2 Answers

Michael - sqlbot On Best Solutions

Enabling cross-zone load balancing does not impact availability because ELBs can send traffic to all configured AZs without the feature enabled. That's not what cross-zone balancing means.

An ELB configured in two availability zones always has at least two balancer nodes, one in each AZ. You can't see this, directly, but if you look under "Network Interfaces" in the EC2 console, you can find the Elastic Network Interfaces (ENIs) attached to the balancer nodes. Each node has one ENI. The service determines how many nodes a balancer has, based on load. This is managed automatically, and you are not billed based on node count.

Cross-zone load balancing controls what each node can do. "Enabled" means the balancer node in zone A can send traffic to instances in zone A or B, instead of just to instances in zone A, and the same for the balancer node in zone B.

This doesn't improve availability because if an availability zone is lost, then the balancer node in that zone is also lost, so the fact that it could have sent traffic to instances in the other zone is immaterial.

Cross-zone load balancing helps ensure that the workload is spread as evenly as possible across all instances behind the balancer, which helps if you have asymmetry -- such as 3 application instances in one AZ and 2 application instances in the other (in this case, the zone with 2 would see proportionally more traffic per instance than the zone with 3) -- or other cases where the instances are not seeing evenly-balanced workloads, which would be more likely when the number of instances behind the balancer is small or if there is wide variation in request processing time due to the complexity of certain requests compared to others.

John Rotenstein On

What changes will increase the availability of the application?

Increased availability means that there are less time periods where the application is serving requests.

  • (B) Multi-AZ database will certainly help because if one AZ fails, it will automatically promote the secondary database server in the other AZ
  • (D) Auto Scaling will certainly help because failed instances will be replaced.

Cross-zone load balancing would help where there are no healthy instances available in an AZ but traffic is being handled by the ELB in that AZ. It is an unlikely scenario, especially with 3 instances in an AZ, but I could understand an argument for it. However, the other two answers are much stronger.

It's worth mentioning that official AWS Certification questions go through several levels of technical review and shouldn't leave such ambiguity in a question. Sample exam questions (be it in an AWS course or otherwise) probably haven't gone through such detailed scrutiny.