Scope
Functional
- Upload/download files of any size; sync a folder across devices.
- Version history and restore; sharing with other users.
- Offline edits sync later.
Non-functional
- Durability: never lose a committed file version.
- Efficient: small edits to large files upload only the changed parts.
- Changes appear on other online devices within seconds.
Size
- 100M users, average 10 GB → 1 EB logical; deduplication typically saves 30%+.
- 1B file changes/day → ~12k/s metadata commits.
Chunks and metadata
- Files are split into chunks (fixed 4 MB, or content-defined chunking with a rolling hash so an insertion near the start doesn't shift every chunk boundary).
- Each chunk is identified by its SHA-256 hash and stored in object storage under that hash: identical chunks are stored once across all users.
- A file version = ordered list of chunk hashes + metadata.
| Store | Contents |
|---|---|
| Block store (object storage) | chunk_hash → bytes (encrypted) |
| Metadata DB (sharded SQL by namespace) | namespaces, files, versions, chunk lists |
| Journal | per-namespace ordered log of changes (cursor-based) |
The architecture
The 30-second summary
Say it in the interview
"Files are split into content-defined chunks addressed by hash and stored once in object storage, which gives deduplication and delta uploads. Metadata lives in a sharded, strongly consistent store with a per-namespace journal; commits are conditional on the base version, and conflicts produce a 'conflicted copy'. Devices get lightweight change notifications and pull changes from their journal cursor, so sync is resumable and robust."
Follow-up questions the interviewer may ask
- How do you sync a 2 GB file where only 1 MB changed?
- How do clients learn about remote changes quickly?
- How do you share a folder with another user?
- How do you restore a deleted file?
Model answers to each of these are in the book.