At a glance
- Did you know
- Layer 4 balancers route by IP and port; layer 7 balancers read HTTP and can route by path or header.
- Rule of thumb
- Least-connections beats round-robin when request times vary a lot.
- Watch out
- It forwards everything, so the layer behind it is what breaks.
Problems that start with it
- Read-heavy product catalog 2,000 req/s, 90% reads through a cache. At 20 s the cache is flushed.
- Slow database rescue The database answers reads in 9 seconds. The API gives up after 5 seconds and retries twice.
- Payment webhook processor 500 webhooks/s through an at-least-once queue. 0.2% of acknowledgements are lost.
- URL shortener 4,000 req/s, 95% redirects. Popular links are far more popular than the rest.
- Event pipeline catching up 2,000 events/s into a 6-partition stream with 30 s retention. 3 consumers.
- RAG support assistant 40 questions/s, 4,000-token prompts, a 6M tokens/min quota and a 25% answer-cache hit rate.
- Edge defence: survive a DDoS 1,500 req/s of real users. At 15 s a 20,000 req/s flood hits for 15 s. Nothing stands in front of the load balancer.
- LLM gateway with fallback 40 chats/s through your AI gateway and a prompt cache to one hosted model. At 20 s the provider has a 15 s outage.
And 267 more on the problems page.
Full lesson coming soon
Lessons are being added one component at a time: how it works, its settings, a live exercise to break and fix it, interview questions and a short check. See the Circuit breaker lesson for what one looks like.