liveBook · Manning

AWS Application Load Balancer

As explained in Amazon Web Services in Action, Third Edition: An in-depth guide to AWS

An application load balancer is an AWS load-balancing service that routes HTTP and HTTPS traffic based on application-level request attributes.

An AWS Application Load Balancer (ALB) distributes HTTP and HTTPS requests among backends such as EC2 instances or containers. It is a type of Elastic Load Balancing (ELB). A browser sends a request to the ALB; the ALB forwards it to a backend, receives the response, and returns that response to the browser. This keeps users from depending on an individual server’s address. section 14.1 section 14.1.1

Use an ALB when HTTP or HTTPS is all the application needs. A Network Load Balancer (NLB) is the suggested alternative for other protocols. ALBs are fault tolerant and scalable, but their backends still need enough capacity to handle requests when another backend fails. section 14.1 section 2.1

A working ALB setup has three required parts:

  • The load balancer defines where it runs, including its subnets, and whether it is internet-facing. section 14.1.1
  • A listener accepts requests on a port and protocol, then forwards them to a default target group. It can also terminate TLS. section 14.1.1
  • A target group identifies the backends and checks their health periodically. The ALB sends traffic to healthy backends; optional listener rules can direct requests to particular target groups. section 14.1.1

Put an ALB in front of web servers

For an HTTP web application, configure an internet-facing ALB in two subnets and permit incoming traffic on port 80 through its security group. Add an HTTP listener on port 80 that forwards to a target group. The supplied CloudFormation example checks each backend at /index.html every 10 seconds and accepts HTTP status codes 200–299 as healthy. Connect an Auto Scaling group so new EC2 instances register with the target group and removed instances deregister. Users reach the ALB rather than choosing a particular server. section 14.1.1

The same pattern works beyond EC2: an ECS service can run containers on Fargate while the ALB distributes requests among them. An ALB can also sit alongside a database, shared filesystem, or queue in a larger application; it handles incoming requests rather than replacing those components. Check current pricing before experimenting: Free Tier allowances have limits, and usage beyond them can incur charges. section 18.5 section 2.1 section 1.4.1

How Amazon Web Services in Action, Third Edition: An in-depth guide to AWS covers it

How deep it goes
Works through load balancer, listener, target group, health checks, and CloudFormation configuration; does not detail ALB internals.
Examples
Shows load-balanced WordPress servers, CloudFormation resources for an Auto Scaling group, and an ECS/Fargate note-taking application.
What it assumes
Introduces ALB components while relying on basic familiarity with HTTP requests, EC2 instances, and web applications.
What you can do after
Build it from scratch with CloudFormation by configuring an ALB, HTTP listener, health-checked target group, and Auto Scaling group.
How it connects
Connects Elastic Load Balancing, EC2, Auto Scaling groups, security groups, target groups, ECS, and Fargate.

Also explained in

Compare how 2 books explain AWS Application Load Balancer →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Amazon Web Services in Action, Third Edition: An in-depth guide to AWS. The section links point to the parts of the book it draws on.