Design Dropbox: file chunking, sync, and storage
Dropbox
Guided ModeMetadata Service: Track Every File Version
As files grow, so does the need to track them: What changed? Who changed it? Which version is current? A dedicated Metadata Service manages file records, version history, and chunk manifests separately from file bytes.
Request Flow
Metadata Service records upload
After chunks land in S3, the API calls the Metadata Service. It creates or updates the file record with name, path, size, owner, and the ordered list of chunk hashes (the manifest).
PUT /api/metadata/files/{file_id}
{
"path": "/Documents/report.pdf",
"version": 3,
"chunks": ["a1b2", "c3d4", ...]
}Version history preserved
Every upload increments the file version. Previous versions remain in the Metadata DB. Dropbox's '30-day version history' is just querying previous version rows.
Device B lists files
Device B authenticates and asks the Metadata Service for its file tree. The Metadata DB returns file records — no S3 involved just for listing files.
Why We Need This
Separating metadata from storage lets you list, search, and version files without touching S3 at all. Metadata queries are fast (indexed DB rows). S3 accesses only happen when bytes are actually needed.
Key Insight
The metadata service is your file system namespace. S3 is just a content-addressed byte store that the metadata service points into.
Step 4 of 8
