Design a Dropbox-style service. A desktop client watches a folder and uploads changes; other devices of the same user download them within seconds. There are 50 million users with 2 billion files, most under 1 MB but some over 10 GB. On a busy weekday clients make about 15,000 metadata requests per second (listing changes, committing new versions) and upload about 1 GB per second of changed data. Large files that change slightly, such as a 2 GB video project, must not be re-uploaded in full. Two devices editing the same file offline must never silently overwrite each other's work.
Functional requirements
Upload, download and delete files and folders from any device
Notify a user's other devices of changes within seconds
Upload only the changed parts of large files and resume interrupted transfers
Keep previous versions for 30 days and allow restore
Detect conflicting edits and keep both copies
Non-functional requirements
Changes reach other online devices within 10 seconds
Once a commit is acknowledged, the file is never lost (11 nines of durability)
Metadata operations return in under 500 ms at p95
Storage cost is reduced by de-duplicating identical content
Constraints and scale
50 million users, 2 billion files, about 5 PB of stored content
15,000 metadata requests per second at peak
About 1 GB per second of uploaded changes at peak
You will practise
Split files into content-addressed chunks to enable delta sync and de-duplication
Separate metadata (versions, folders) from blob storage
Push change notifications and resolve concurrent edits with version checks
Show 3 hints
If files are cut into 4 MB chunks named by their hash, what happens when two users upload the same video?
How does a device know which version it last saw, and how does the server reject a stale commit?
Should file bytes flow through your API servers at all?