Does it make sense to have an Amazon Elastic Load Balancer with just one EC2 instance?

Rober picture Rober · Dec 6, 2014 · Viewed 15.5k times · Source

my question is simple. Does it make sense to have an Amazon Elastic Load Balancer (ELB) with just one EC2 instance?

If I understood right, ELB will switch traffic between EC2 instances. However, I have just one EC2 instance. So, does it make sense?

On the other hand, I´m using Route 53 to route my domain requests domain.com, and www.domain.com to my ELB, and I don´t see how to redirect directly to my EC2 instance. So, do I need an ELB for routing purposes?

Answer

Matt Houser picture Matt Houser · Dec 7, 2014

Using an Elastic Load Balancer with a single instance can be useful. It can provide your instance with a front-end to cover for a disaster situation.

For example, if you use an auto-scaling group with min=max=1 instance, with an Elastic Load Balancer, then if your instance is terminated or otherwise fails:

  1. auto-scaling will launch a new replacement instance
  2. the new instance will appear behind the load balancer
  3. your user's traffic will flow to the new instance

This will happen automatically: no need to change DNS, no need to manually re-assign an Elastic IP address.

Later on, if you need to add more horsepower to your application, you can simply increase your min/max values in your autoscaling group without needing to change your DNS structure.