Transport Layer
Uses IP addresses, ports, and transport protocols. It sees less of the request, allowing simple and fast routing decisions.
Lesson 3 · Horizontal scaling
The client sends GET /api/products to
localhost:7312. Nginx understands the HTTP path and
distributes requests across healthy Catalog Service instances.
Interactive architecture lab
Run six requests to reveal round robin, stop one instance, and verify that the healthy replicas keep answering.
http://localhost:7312/api/products
Start the lesson, then execute a request through the Load Balancer.
Execute a request to inspect the original response.
Execute a request to inspect the response headers.
localhost:7312
catalog_poollocalhost:7312The only address known by the client.
loadBalancer1:80Nginx accepts requests here inside Docker.
Round robinNginx uses this strategy by default.
HTTP path /api/productsThis is why the balancer is operating at Layer 7.
upstream catalog_pool {
server catalogService1:6212;
server catalogService2:6212;
server catalogService3:6212;
}
Start the lesson to see distributed requests.
Healthy upstream pool
Observe the distribution
Every request reaches exactly one healthy Catalog instance. Nothing is served from cache in this lesson.
No requests yet
Availability experiment
Run six requests and observe an even distribution.
Kill any replica from its compact card.
Send more requests; healthy replicas continue answering.
Restore the pool and return to three instances.
What this teaches
A load balancer sits in front of multiple application servers and distributes incoming traffic between them.
Uses IP addresses, ports, and transport protocols. It sees less of the request, allowing simple and fast routing decisions.
Understands HTTP methods, paths, headers, hostnames, and cookies. It can make content-aware routing decisions with additional processing.
A Load balancer behaves much like a specialized reverse proxy. In
this lesson, Nginx can see the /api/products path
before selecting a Catalog replica.
What this gives us
What still remains