18.4 Which load balancer to use
Why the type matters
"Load balancer" is four AWS products plus the manual method you just did. They do not do the same job. Picking the wrong one means host rules that cannot exist, or a static IP you needed and did not get.
What each one is for
| You have this problem | Use this | Not this |
|---|---|---|
| You have no balancer, and you will send people to IP1 or IP2 yourself | Manual DNS, or two addresses you hand out | An Application Load Balancer you forget to delete |
HTTP or HTTPS, and example.com should not go to the same place as api.example.com, or / should not go to the same place as /api/ |
Application Load Balancer | A Network Load Balancer, which does not read the host or the path |
| TCP or UDP, or a partner must allow one fixed IP | Network Load Balancer | An Application Load Balancer, whose addresses change behind its DNS name |
| Traffic must pass through firewall appliances you run | Gateway Load Balancer | An Application Load Balancer in front of Nginx |
| An old account already has a Classic Load Balancer | Leave that Classic balancer until you move it | A new Classic balancer created for this lab |
One line each:
- Manual DNS when you have no balancer.
- ALB for HTTP/HTTPS and path or host rules.
- NLB for TCP/UDP and a static IP.
- GWLB for firewall appliances.
- Classic only if an old setup already uses it.
How to point at the right row before you click Create
- Write the protocol the user speaks. For this lab's website, write HTTP.
- Write whether you need a different target for a host name or a path. For example.com and
/api/, write yes. - If the protocol is HTTP or HTTPS and the answer is yes, choose Application Load Balancer.
- If the protocol is raw TCP or UDP, or someone needs a fixed IP, choose Network Load Balancer.
- If the next hop is a firewall appliance, choose Gateway Load Balancer.
- If you are looking at an old Classic balancer that already exists, do not create another one.
- If you have no balancer and you are only proving the idea, stay on the two IP addresses from section 18.3.
- You should see one chosen row, not five balancers created "just in case".