Load balancing workloads across redundant systems
To effectively leverage the redundancy provided by AZs, you need to employ load-balancing techniques, especially if you receive traffic from outside your system. Load balancing allows you to distribute incoming traffic across multiple targets, such as EC2 instances or containers, running in different AZs. At the time of writing this book, AWS Elastic Load Balancing, a fully managed service that, as the name implies, allows you to use load balancing capabilities at a very high scale, proposes three types of load balancers according to the usage.
Application Load Balancers are generally meant for HTTP and HTTPS traffic (layer 7, OSI model) and route traffic based on the content of the request, such as HTTP headers, paths, hosts, and more. Network Load Balancers (NLB), however, are used for routing TCP (layer 4), UDP, and TLS traffic. NLBs trade features for extreme performance. The third one is a Gateway Load Balancer (layer 3) to...