Compute storage for 1M docs at 768 dim, float32
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
You have 1,000,000 documents. Each is embedded as a 768-dimensional float32 vector. Compute the raw storage required (vectors only). Express in GB (1 GB = 10^9 bytes).
1M × 768 × 4 bytes = 3.072 GB. A million 768-dim float32 vectors fits comfortably in a few GB of RAM and is the canonical 'small index' size.
Picture a million flashcards, and each one has 768 numbers written on it in tiny print. Each number takes about 4 bytes to store. Multiply the cards by the numbers per card by the bytes per number, and you have your total. That comes out to a little over 3 gigabytes, roughly the size of a single high-definition movie. A million-doc index at this scale fits in the RAM of a normal developer laptop, which is why this is the canonical 'small index' size in tutorials. Scaling up to a hundred million flashcards turns that movie into a whole streaming library, and you start needing more serious infrastructure.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
Compute 3.072 GB via N × d × 4, identify the small-index regime, walk the order of magnitude scaling, and close on when storage stops being a free design choice.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Calling this number 'production storage'. It is raw vector storage only; HNSW overhead, payload, and replication can push the realized footprint 5-10x higher.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.