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

Hash the URL so a given page always lands on the same server. The trick behind cache tiers: each item lives on one server and stays warm.

URL hash: same URL, same serverauto
URL/cats.jpghashto a fixed serverserver 1server 2server 3

Hash the URL to pick a server, so a given page always lands on the same one. Perfect for caches: each item lives on one server, so it stays warm.

Consistent hashing: the ring

From: How a Load Balancer Sticks

Servers and keys on a ring; each key belongs to the next server clockwise. Remove or add a server and only its slice of keys moves, about 1/N, instead of nearly all of them.

Consistent hashing: the ringauto
Aserver ABserver BCserver Ceach key belongs to thenext server clockwisea keymoved this step9 keys, all placedthe rest stayed put

Start: three servers on the ring. Each key belongs to the next server going clockwise.

Maglev: one fast lookup table

From: How a Load Balancer Sticks

Google's Maglev does consistent hashing's job with a single fixed lookup table: near-perfect even distribution and O(1) lookups, ideal for the fastest layer 4 balancers.

Maglev: one fixed lookup tableauto
key hashes toslot 3server 1123123123123one array lookup (O(1)), and the slots are split almost perfectly evenly among the servers

Google's Maglev builds a single fixed lookup table instead of a ring: near-perfect even distribution and O(1) lookups, ideal for very fast layer 4 balancers. The table is rebuilt only when servers join or leave.

Visualizers — Sachin Gupta