- Layer 4 vs Layer 7?
- L4 balances on TCP/UDP (fast, protocol-agnostic). L7 balances on HTTP (can route by path, header, cookie). L7 is more common for web apps; L4 for low-latency or non-HTTP services.
- Common algorithms?
- Round-robin (simple), least-connections (balances load for long-lived connections), IP hash (sticky sessions). Weighted variants for heterogeneous backends.
- What are health checks?
- Periodic pings that remove unhealthy backends from rotation. Check something that exercises the service (not just TCP connect) to catch real failures.
- Failure modes?
- Cascading failures (retries slam a struggling service), thundering herd (all traffic goes to the healthy remaining instance), split brain (LB thinks service is down when it isn't).