An Application Load Balancer (ALB) is Elastic Load Balancing’s Layer 7 load balancer. It gives clients one DNS name, then spreads HTTP and HTTPS requests across healthy targets such as EC2 instances in multiple Availability Zones.
What problem does an ALB solve?
A single server is a single point of failure and a capacity ceiling. An ALB fronts your app so you can add or remove targets without changing the public URL, keep serving traffic when one instance fails health checks, and later add host or path rules for more advanced routing.
When should you use an ALB?
Use an ALB for web apps and APIs that speak HTTP/HTTPS. Prefer a Network Load Balancer (NLB) when you need extreme Layer 4 performance, static IPs, or non-HTTP protocols. Pair the ALB with a target group, then add ACM for HTTPS and HTTP to HTTPS redirects for production.
How traffic flows
Client → ALB listener (port/protocol) → listener rules → target group → healthy registered targets. Health checks run per target group so unhealthy instances stop receiving new requests.
Internet-facing vs internal
Choose Internet-facing for public websites (needs public subnets). Choose Internal when only resources inside your VPC should reach the load balancer.
Layer 7 routing.
Beyond simple round robin, ALB rules can match host, path, headers, query strings, and HTTP methods—useful for microservices behind one hostname. See path-based routing.
Two Availability Zones minimum.
AWS requires subnet mappings in at least two AZs. Put healthy targets in those zones (or understand cross-zone behaviour) so traffic has somewhere to go.
Not a substitute for DNS alone.
Point your domain at the ALB with Route 53 alias records when you leave the raw ALB DNS name behind.
Reference
Core Concepts
Terms you will see while creating an ALB:
Concept
Meaning
Listener
Checks for connections on a protocol/port (e.g. HTTP:80, HTTPS:443)
Listener rule
Conditions + actions; every listener needs a default forward/redirect/fixed response
Target group
Registered backends plus health checks and routing algorithm
Scheme
Internet-facing (public) or internal (VPC-only)
Network mapping
VPC + subnets in ≥ 2 Availability Zones
Security groups
Firewall rules for client→ALB and ALB→target traffic
DNS name
AWS-managed hostname clients use until you map a custom domain
Before you start
Prerequisites
Have these ready before you create the load balancer:
An AWS account with access to EC2 and Elastic Load Balancing.
A target group with at least two healthy EC2 (or other) targets—ideally in different AZs.
A VPC with public subnets in at least two Availability Zones for an internet-facing ALB.
Target health matters.
The ALB only forwards to healthy targets. Confirm health checks pass before testing the DNS name.
Walkthrough
Examples
Create an internet-facing ALB in front of two demo apps (React and Next.js) so you can see traffic move between targets.
Example 1 — Prepare Distinct EC2 Targets
Use two different apps so refreshes can show which instance answered.
Most ALB “it doesn’t work” moments are health checks, security groups, or empty Availability Zones.
health
Unhealthy targets get no traffic
If every target fails health checks, the ALB returns errors. Match the health-check path, port, and success codes to your app.
sg
Security groups block the path
Open client→listener ports on the ALB group, and ALB→target ports on the instance groups. Missing either side looks like a dead site.
az
AZs without targets
Enable only AZs that have (or will have) targets, or plan capacity so remaining zones can absorb a zonal failure.
stickiness
Sticky sessions hide round robin
If stickiness is on, browsers may keep hitting one instance. Turn it off while demonstrating distribution.
https
Certificate Region mismatch
ACM certificates for an ALB must be in the same Region as the load balancer. CloudFront is the special case that needs us-east-1.
idle
Idle timeout vs long requests
Long uploads or slow APIs can hit the ALB idle timeout. Raise it carefully or make the app send keep-alive traffic.
Remember
Key Takeaways
Role: an ALB is a Layer 7 front door that spreads HTTP/HTTPS across healthy targets.
Setup: map ≥ 2 AZs, attach security groups, and forward listeners to a target group.
Health: only healthy targets receive traffic—fix checks before debugging the DNS name.
Next: add ACM HTTPS, redirects, and Route 53 when you leave the demo DNS name.
One line: one ALB DNS name, healthy multi-AZ targets, listeners that forward to a target group.
Frequently Asked Questions
An Application Load Balancer (ALB) is a Layer 7 load balancer that distributes HTTP and HTTPS traffic across targets such as EC2 instances, IP addresses, or containers in one or more Availability Zones within a Region.
ALB works at Layer 7 and is ideal for HTTP/HTTPS with host, path, header, and method routing. A Network Load Balancer (NLB) works at Layer 4 (TCP/UDP/TLS) and is built for ultra-high performance, static IPs, and connection-level features.
You must map subnets in at least two Availability Zones so AWS can place redundant load balancer nodes. That improves fault tolerance if one zone has issues.
Yes. The ALB continuously health-checks registered targets in each target group used by a listener rule and routes requests only to targets that pass those checks.
The default is round robin. You can also choose least outstanding requests at the target group level. Sticky sessions can make the same client keep hitting one target.
No. You can start with an HTTP listener on port 80. For production, add an HTTPS listener on 443 with an ACM certificate, then redirect HTTP to HTTPS.