Facebook Haystack: Cutting Disk Reads Per Photo Lookup

Facebook's 2010 Haystack paper describes a photo read path that spent disk operations finding a file before reading the image bytes.
Under the earlier NAS-backed filesystem layout, every photo lived in its own file. Directory entries and per-file inodes were too large to fit entirely in RAM across billions of photos, and long-tail images routinely missed the CDN cache. Serving one old photo often took multiple disk seeks just to translate a path and read metadata before the drive ever touched the JPEG payload.
Haystack appended many photos sequentially into multi-gigabyte volume files and held a compact per-needle index in memory (~10 bytes per photo per replica). Because the byte offset and size stayed resident in RAM, an uncached photo read dropped to a single disk read directly to the payload.
That trade worked because user photos were written once, read often, never modified in place and deleted asynchronously via compaction. POSIX directory trees, fine-grained permissions and per-file timestamps earn their keep in general-purpose storage. Paying hundreds of metadata bytes in RAM for each immutable thumbnail simply mismatched the workload.
The sharpest lesson in the paper is diagnostic discipline. 'We store billions of photos' sounds like a petabyte capacity problem. 'Our disks run out of random IOPS resolving inodes on long-tail reads' names the actual bottleneck and points straight to the fix.
Look at the arithmetic on a spindle capable of 300 random I/O operations per second. When an uncached photo takes three serial seeks across directory, inode and data blocks, that drive tops out around 100 photos per second. Collapsing metadata lookup into RAM raises the ceiling toward 300 photos per second on the exact same disk, regardless of how many free terabytes remain on the platter.
Workload assumptions sit right underneath that win. Materializing four thumbnail resolutions multiplies needle count by four in the in-memory index, which is why per-object RAM overhead still determines host density. Heavy in-place mutations or synchronous physical erasure for compliance immediately complicate append-only volume files and force background compaction trades.
Nobody building on cloud object stores in 2022 needs to clone a 2010 custom volume store from scratch. Counting hidden metadata round-trips on your cold read path, on the other hand, never goes out of style. Haystack succeeded because its authors noticed that locating an immutable blob and storing its bytes had completely different memory-to-disk economics.
Paper: Beaver et al., Finding a Needle in Haystack: Facebook's Photo Storage, OSDI 2010.
Continue in Paper Reviews
A Tighter Bound, More Mistakes
In Lamb, Torr, and Rudner's November 2026 paper on LLM judges, what caught my attention is that the tightest statistical bound comes from an adapter making…
SGLang RadixAttention: Put the Prompt Timestamp Last
Giving a language model the current timestamp is reasonable. Putting that changing timestamp on line one of a long system prompt is expensive. That is the…
