Back to sketch

SYSTEM DESIGN SKETCHBOOK / PRACTICE SHEET / NO. 04

Design a Dropbox-style file sync service

Advanced · 45 min · Storage & data modeling

A user installs a desktop client, picks a folder, and expects every file in it to appear on their other laptop and phone. They edit files offline on a plane, reconnect, and expect everything to reconcile without losing work.

Requirements

  • Sync a folder tree (create, edit, rename, move, delete) across all of a user's devices.
  • Upload and download only the parts of a file that changed.
  • Keep 30 days of previous versions and deleted files for restore.
  • When two devices change the same file concurrently, keep both versions rather than dropping one.

Constraints and assumptions

  • 50 million users, 10 million daily active, about 2.5 devices each.
  • Average account holds 10 GB in about 5,000 files; single files can be up to 50 GB.
  • 100 million file changes a day across the service.
  • A change should appear on the user's other online devices within 10 seconds.
  • Devices may be offline for weeks and must catch up correctly when they return.

Out of scope for the first sketch

Sharing folders between users · Real-time co-editing inside a document · Previews and full-text search

Draw your design

Rough math and notes

Done on paper? Compare with the worked approaches