Log inStart free
LESSON 33.25 · 5 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW

Proxies and L4 vs L7 load balancers

One address hides four replicas, and the door's layer decides who gets the flood.


Pro lesson. Stage 1 is free to watch. Pro opens all 5 stages, 2 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 33.25 · GATEWAY BAY3 CONNECTIONS · ONE ADDRESS
01
Stage 1 of 5 · One address
Each client opens 1 connection to one address. A reverse proxy there hides the replicas W1 to W4.
Explain it simply

On the left, three clients send requests to one name, api.llm.example. They never see the four replicas on the right. A reverse proxy is a server that takes requests for other servers. The replicas can change behind it, and the clients do not notice.

Three clients, K1, K2 and K3, each open 1 connection to the front door at api.llm.example. The replicas W1 to W4 sit behind the door, hidden.

requestsTLS, rate limitwork429, idle replicahidden or encrypted
L4 balancerapi.llm.example:443K1 chat app15 requests198.51.100.11K2 batch job12 requests198.51.100.22K3 flood40 requests198.51.100.33W1hidden behindthe doorW2hidden behindthe doorW3hidden behindthe doorW4hidden behindthe doorclientsfront door: a reverse proxyreplicasprivate: 10.0.0.1–43 connections = 3 clients × 1L4 balancerapi.llm.example:443K1 chat app15 requests198.51.100.11K2 batch job12 requests198.51.100.22K3 flood40 requests198.51.100.33W1hidden behindthe doorW2hidden behindthe doorW3hidden behindthe doorW4hidden behindthe doorclientsfront door: a reverse proxyreplicasprivate: 10.0.0.1–43 connections = 3 clients × 1
Toy: 3 API keys, 67 requests, 4 replicas
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
nconn=3×c\sy{n}{data}{n_{\text{conn}}} = 3 \times \sy{c}{param}{c}
nconn=3×1=3n_{\text{conn}} = 3 \times 1 = 3

Each of 3 clients opens c connections.

Common mix-ups

MYTHAn L4 load balancer spreads requests evenly.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01Under L4, give each client 4 connections. Does a replica still sit idle?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
  • 4 more stages and 2 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.