Member-only story
System Design Interview Series:27/30
[Case Study: Designing File Storage]
Parts 10 to 26 designed everything around the files of the file-sharing service: where their metadata lives, how it is partitioned, replicated, migrated, searched, and notified about. None of them stored a single byte of a file. This case study does. It is the storage system that holds the bytes: how a file is cut into chunks, how an upload survives a dropped connection, how identical data is stored once, how bytes are kept durable for years at a cost the business can pay, and how a deleted chunk is reclaimed without ever deleting one that someone still needs. It is also the Part where the bill is largest, because here the numbers are petabytes and each design choice moves millions of dollars a month.
Series: System Design Interview Series, Part 27 of 30
The Problem
The file-sharing service has 100 million users and 100 billion entries. Metadata (Part 10) is 100 TB; the file contents are three or four thousand times larger. The first storage design was a plain object store with three full copies of every file. Five incidents show why it did not last.
- The files that went missing. A background cleanup job deleted chunks that no file referenced. At the same moment, a client uploading a new file asked the server “do…




![Python DSA Coding Interview Series:15/29 [Tree BFS, Binary Search Trees and Paths]](https://webproxy.poorya-velaei-d67.workers.dev/https://miro.medium.com/v2/resize:fit:1358/format:webp/1*WiqEcxsecBYN5dkcpD44ZA.png)
![Python DSA Coding Interview Series:4/29 [Prefix Sums and Difference Arrays]](https://webproxy.poorya-velaei-d67.workers.dev/https://miro.medium.com/v2/resize:fit:1358/format:webp/1*jA7nmI8jC4yChSu3Ue0w0w.png)



