System Design

File Sync

Design a file sync and storage service like Dropbox or Google Drive.

Functional requirements

  • Users can upload, download, and delete files and folders from any of their devices via a desktop client and API.
  • Files edited on one device automatically sync to the user's other devices, propagating only what changed.
  • The system detects and handles concurrent edits to the same file from multiple devices without silently losing data.
  • Users can view version history for a file and restore a previous version.
  • Users can share a file or folder with other users with read or read-write access.

Non-functional requirements

  • Durability is paramount: committed file data must never be lost (target 11 nines durability for file content).
  • Sync latency: after a save on one device, other online devices should see the change within ~10 seconds under normal conditions.
  • The metadata/sync layer favors consistency (a client must never see acknowledged writes disappear or sync a stale version over a newer one); file-content availability may favor availability with retries.
  • Clients operate on unreliable networks: sync must survive disconnects, resume interrupted transfers, and never corrupt local or remote state.
  • All file content encrypted in transit and at rest; access to shared content strictly enforced by ACLs.

Scaling & constraints

  • 200M registered users, 50M DAU; average user has 3 active devices.
  • Average user stores 5 GB across ~1,000 files; average file size ~1 MB, but files up to 10 GB must be supported.
  • Read:write ratio on file content is roughly 5:1; an active user modifies ~10 files per day.
  • Typical edit modifies a small fraction of a file (e.g., appending to a log, editing a document); ~30% of uploaded content is duplicated across users (installers, media, shared docs).
  • Version history retained for 180 days; deleted files recoverable for 30 days.
  • User base growing ~30% per year.

Out of scope

  • Real-time collaborative editing (Google Docs-style operational transforms/CRDTs on document content).
  • Full-text search over file contents.
  • Client UI details and OS-specific filesystem watcher implementation.
  • Billing, quotas enforcement UX, and admin/enterprise features.

Sign in to save your progress

AI design evaluation

Get a grounded score, what your design does well, its gaps, and what to study next.

Sign in to evaluate

Sign in to get AI feedback on your design.