Load Balancer

Understand AWS load balancers for distributing traffic, health checking, TLS termination, routing, and resilient application access.

Last reviewed: June 2026

·AWS CloudAWS CLI v2AWS SDKsAWS Well-Architected Framework
✅
Quick Understanding: Load Balancer helps teams design, build, secure, operate, and troubleshoot AWS workloads. In enterprise projects, the important questions are ownership, blast radius, automation, observability, compliance, and cost.

🔍 What Is It?

Elastic Load Balancing distributes incoming traffic across targets such as EC2 instances, containers, IP addresses, and Lambda functions.

Common types include Application Load Balancer for HTTP/HTTPS, Network Load Balancer for TCP/UDP and extreme performance, and Gateway Load Balancer for network appliances.

🎯 Why Do We Need It?

Applications need stable entry points while backend instances change, fail, deploy, and scale.

Load balancers provide health checks, TLS termination, host/path routing, and traffic distribution across AZs.

Common developer mistakes:

  • →Choosing defaults without checking security, cost, or failure behavior
  • →Treating AWS services as isolated tools instead of part of an architecture
  • →Skipping tags, alarms, IAM review, backups, and runbooks until production incidents happen
  • →Building manually in the console and then struggling to reproduce environments

🏗️ What Happens in Real Projects?

A SaaS application may use an internet-facing ALB with HTTPS listeners. It routes /api traffic to backend services, /admin to an admin target group, and only sends requests to targets passing health checks.

Security groups allow inbound internet traffic to the ALB and allow app traffic only from the ALB security group.

⚙️ How It Works

A load balancer has listeners, rules, target groups, health checks, and subnet mappings.

Requests reach the listener, rules decide the target group, and healthy targets receive traffic. If a target fails health checks, it is removed from rotation until healthy again.

💻 Example

ALB routing model — Host and path routing for an enterprise web application.

text
ALB listener: HTTPS 443
Rule 1: api.company.com/*      -> orders-api target group
Rule 2: admin.company.com/*    -> admin-service target group
Rule 3: www.company.com/static -> frontend target group
Health check: /health/ready
Security: targets allow inbound only from ALB security group

🤔 Common Confusions

❓ Is ALB the same as NLB?

No. ALB is Layer 7 HTTP/HTTPS routing. NLB is Layer 4 TCP/UDP with very high throughput and static IP support.

❓ Does a load balancer make a broken app healthy?

No. It only routes around targets that health checks mark unhealthy.

❓ Should EC2 instances be public if ALB is public?

No. Usually the ALB is public and application instances stay private.

🚨 Common Production Issues

**Bad health checks** mark unhealthy apps healthy or healthy apps unhealthy.

**Open target security groups** allow internet traffic to bypass the load balancer.

**No cross-AZ capacity planning** creates uneven traffic during AZ issues.

**TLS misconfiguration** causes expired certificates or weak policies.

✅ Best Practices

Use ALB for HTTP routing and NLB for TCP/UDP or static IP needs

Keep application targets in private subnets where possible

Use meaningful readiness health checks

Terminate TLS with managed certificates through ACM

Log load balancer access for investigation and analytics

Protect public endpoints with WAF where required

🏛️ Architect's Note

Senior Architect's Perspective

The load balancer is often the control point between users and failure. Health checks, routing rules, TLS, security groups, and logs should be treated as production architecture, not just connection plumbing.

💬 Frequently Asked Questions

Interview: How would you explain Load Balancer in a real AWS project?

Load Balancer should be explained through the business workload it supports, the AWS responsibility boundary, the failure modes, the security controls, and how it is monitored and automated.

Interview: What production mistake do developers commonly make with Load Balancer?

The common mistake is using the service successfully in a lab but not designing for least privilege, multi-AZ resilience, alarms, cost visibility, and repeatable infrastructure.

Can ALB route by path?

Yes. ALB supports host-header and path-based routing for HTTP and HTTPS applications.

What should a health endpoint check?

It should prove the app can safely receive traffic, while avoiding overly deep checks that flap during minor dependency issues.

🎯 Key Takeaways

1Load balancers distribute traffic across healthy targets
2ALB is best for HTTP/HTTPS routing
3Targets should usually be private
4Health checks determine real availability behavior

🎯 Practice this topic in interviews

↗ Where this topic fits

Sources

Sources / References

Use these AWS references to verify the concept in official docs and continue into the most relevant SplashRide pages.