Visualizers

Learn by moving things

Interactive explainers for the ideas behind retrieval, embeddings, and agents. A formula tells you what is true; dragging a vector shows you why. Each one also appears inside the article it belongs to, and runs entirely in your browser, so drag, poke, and break it.

Portrait of Sachin Gupta rendered in binary

The simplest rule: deal each request to the next server in turn, around and around. Even when servers are identical, but blind to how busy any one of them is.

round-robinstaticauto
request#0load balancerround-robinserver 10 routedserver 20 routedserver 30 routed

Round-robin: each server gets the next request in turn, like dealing cards. Even and simple, but it ignores how busy each one is.

Round-robin in proportion to a weight, so a bigger server gets a bigger share. Also how canary releases work: give the new version weight 1 and the old one weight 9.

weighted round-robinstaticauto
request#0load balancerweighted round-robinserver 1w=1 · 0server 2w=2 · 0server 3w=3 · 0

Weighted round-robin: bigger servers get a bigger share of the rotation. Server 3 has weight 3, so it is dealt three times as often as server 1.

A dynamic rule: send each request to the server handling the fewest connections right now. Great for long-lived, uneven work like database sessions or WebSockets.

least connectionsdynamicauto
request#0load balancerleast connectionsserver 124 connsserver 248 connsserver 38 conns

Least connections: send the request to whichever server is handling the fewest right now. Good when connections are long-lived and uneven.

Visualizers — Sachin Gupta