MentorNode
Start free
Media & Large-Scale FilesHarddesign-file-sync

Design a File Sync & Sharing Service (Dropbox)

Design multi-device file sync: content-addressed chunks, delta uploads for a one-byte edit in a 2 GB file, and a conflict story for two devices editing offline.

Chunking & DedupDelta SyncMetadata JournalConflict Resolution
Traffic & Capacity Estimates:

500M users · 100 PB stored · 50k sync operations/second · 4 devices per user

Functional Requirements

  • •Split files into content-addressed chunks and upload only chunks the server doesn't have.
  • •Maintain a per-user metadata journal so any device can catch up from its last known cursor.
  • •Detect conflicting concurrent edits and materialize both versions rather than losing one.
  • •Support shared folders with per-user permissions and selective sync.

Non-Functional Requirements

  • •A small edit to a large file must transfer kilobytes, not gigabytes.
  • •Sync must resume correctly after a network drop or a client crash mid-upload.
  • •Metadata operations must be fast and strongly ordered per user.

Back-of-the-Envelope Math

  • 4 MB chunks: a 2 GB file is 500 chunks; a one-chunk edit uploads 4 MB instead of 2 GB.
  • Cross-user deduplication on popular files can cut stored bytes by 30-50% and raises real privacy questions.

Key Architectural Trade-offs

  • Fixed-size chunking is simple and shifts every boundary when bytes are inserted; content-defined (rolling hash) chunking survives insertions and costs CPU on every file.
  • The metadata journal is the ordering authority and the scaling bottleneck — it must be strongly consistent per user while chunk storage stays eventually consistent.
  • Automatic conflict merging is impossible for arbitrary binaries, so 'conflicted copy' is a deliberate product decision, not a bug.

Click or drag a component onto the canvas, then connect the handles to draw the data flow.

3 nodes · 2 edges

Components · 35

Client & Edge4
Compute & Gateway7
Storage & Caching11
Messaging & Streaming6
Coordination & Ops5
Intelligence2
Canvas overview