Request path
client → DNS → load balancer → healthy target in AZ-A or AZ-B- The load balancer should remove unhealthy targets.
- The application should expose a meaningful readiness/health endpoint.
Understand L4 versus L7 load balancing, health checks, multi-AZ failure domains and how load balancing integrates with autoscaling.
Layer 4 load balancing primarily distributes connections using transport information such as IP address and TCP/UDP port. Layer 7 load balancing understands application protocols such as HTTP and can route using host, path or headers.
Choose the layer based on protocol needs, observability and routing requirements rather than assuming L7 is always better.
A load balancer can probe targets and route only to those considered healthy. A useful health endpoint should validate enough of the service to signal readiness without becoming an expensive dependency test.
Readiness, liveness and external load-balancer health checks solve related but different problems.
Running two instances in one failure domain does not provide the same resilience as spreading capacity across independent zones. Network, compute and data dependencies must also be distributed.
An autoscaling system adjusts the number of compute targets based on policy. The load balancer discovers/uses healthy targets and distributes traffic. Integration needs registration, health checks, warm-up and safe scale-in behavior.
client → DNS → load balancer → healthy target in AZ-A or AZ-BGoal: Model a health-aware target pool locally.
cat > /tmp/lb.py <<'PY'
targets=[{'name':'a','healthy':True},{'name':'b','healthy':False},{'name':'c','healthy':True}]
healthy=[t['name'] for t in targets if t['healthy']]
assert healthy==['a','c']
for i in range(6): print('request',i,'->',healthy[i%len(healthy)])
PYpython3 /tmp/lb.pyMark both healthy targets as failed and explain why a load balancer cannot manufacture capacity when no backend is ready.Production high availability depends on independent zones, accurate health checks, sufficient healthy capacity and safe autoscaling integration.
Inspect existing load balancers/target health without creating billable load-balancer resources.
aws elbv2 describe-load-balancers --query 'LoadBalancers[].{Name:LoadBalancerName,Type:Type,Scheme:Scheme,DNS:DNSName}' --output tableaws elbv2 describe-target-groups --query 'TargetGroups[].{Name:TargetGroupName,Protocol:Protocol,Port:Port}' --output tableOpen each answer only after you have tried to answer the question yourself.
L4 routes transport connections using network/port information, while L7 can make application-protocol-aware decisions such as HTTP host or path routing.
To avoid sending new traffic to targets that are not ready to serve it.
To reduce dependence on a single failure domain when the complete traffic path is distributed.
Healthy capacity must exist in another failure domain, the load balancer must be able to route to it, and dependencies/data paths must also tolerate the failed zone.
Progress is saved in this browser immediately. When you sign in to My Learning, it can also sync across devices.
Attempt the core lab and knowledge checks before marking the module complete.