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

Write-through: one write, two copies

From: Caching: Don't Do the Same Work Twice

Like writing on carbon paper: one stroke makes two identical copies. Every write lands in the cache and the database together, so they never disagree. The cost is the write waits for both.

Write-through: one write, two copiesauto
writecacheupdated nowdatabaseupdated nowalways in sync

One write, two identical copies made at once. The cache and the database update together, so they never disagree. The write just waits a little longer for both.

Write-back: cache now, database later

From: Caching: Don't Do the Same Work Twice

Like a sticky note you file at the end of the day. The write hits the fast cache instantly and flushes to the database later. Fast, but a crash in the gap loses those writes.

Write-back: cache now, database laterauto
writecachenew valuelater...databasestill old

The write hits the fast cache and returns instantly. The database is not touched yet, so for a moment the two disagree.

Like filing a paper straight into the cabinet instead of leaving it on your desk. The write skips the cache and goes to the database; the cache is filled only later, on the first read that misses, not on the write itself.

Write-around: skip the cache, fill on readauto
writefirst readnext readwritecacheskipped, emptydatabasewrittenstraight to the database, cache untouched

The write goes straight to the database and skips the cache entirely. Nothing clutters the cache with data nobody has asked to read. So the cache does not hold this value yet.

Visualizers — Sachin Gupta