diff/reel
All reels

sandboxed iframe · 46s loop · 32 KB

Networking

L4 vs L7 Load Balancing

One picks a server before it knows what you asked for. The other reads the request first.

Posted Aug 15, 2026 · 8 views

A load balancer sits in front of your servers and picks one per request. *When* it picks decides what it is able to do.

Layer 4 works at the transport layer: it forwards the connection without opening it, choosing a server from IP and port alone. It is fast and protocol-agnostic, and it cannot route on anything inside the request, because it never looks.

Layer 7 works at the application layer: it terminates the connection and reads the path and headers, so /api and /video can go to different servers, and retries, rewrites and TLS termination become possible. It costs more per request and has to understand the protocol.

The layer is not a quality ranking — it is a statement about how much the balancer is allowed to know.

Related reels