Types of ELBs
There are different types of LoadBalancers based on request layer, supported targets and protocols.
Application Load Balancer
it operates at the request level and routes based on content of request (layer 7)
listens for HTTP and HTTPS, gRPC protocols
routing can be based on IP Address, Path, Host, HTTP Header, QueryString Params
supported targets are instances, lambda functions, IP Addresses and containers
Network Load Balancer
it operates at the connection level and routes based on IP Protocol (layer 4)
listens for TCP, UDP, TLS and TCP_UDP protocols
supported targets are UDP and static IP addresses
you can't assign a security group to a NLB
offers ultra high performance, low latency and TLS offloading at scale
can have a static IP / Elastic IP and preserves source IP address
A typical use case for NLB is when our clients need to whitelist static IPs - with ALB you would know the DNS names but IP would change all the time, while NLB can have static adresses.
Classic Load Balancer
The old generation of ELBs, not recommended/available for new applications (useful if you are using EC2 Classic Instances).
performs routing on layer 4 and 7. Despite not having so many features as ALB it has something that is not provided by ALB like
support for EC2 classic
support for TCP and SSL Listeners
support for sticky sessions using application generated cookies
cross-zone load balancing can be disabled
does not support target groups, but rather the target instances can be directly selected.
Gateway Load Balancer
A newer type of ELB very useful in front of virtual appliances such as firewalls , Intrusion Detection/Prevention Systems (IDS/IPS) and when deep packet inspection is necessary.
operates at level 3
listens for all packets on all ports
forwards traffic to the target group specified in the listener rules
exchanges traffic using GENEVE protocol on port 6081