Opening Scenario
Your backend API runs on three EC2 instances. It works fine in development, but at production scale you have a problem: every request hits the same instance. One machine is maxed out while the others sit idle. Worse, you've split the API into separate services — /auth, /orders, and /products are handled by different codebases, but they all live behind a single domain. How do you route traffic intelligently across instances and services?
Question Progression
1. Who Decides Where a Request Goes?
Question: You have multiple backend instances serving the same API. A client sends a request to api.example.com. Which instance handles it — and who makes that choice?
Reasoning: You could give clients a list of IP addresses and let them pick, but that breaks the moment an instance goes down. You could use DNS round-robin, but DNS caches make it unreliable. What you need is a…
In the full tutorial
- When to Reach for ALB
- Interview Follow-Ups