KatInterview

Design a Multi-Tenant File Sync and Share Platform

System DesignModel answer
MediumModel answerSystem Designsystem-designobject-storagededuplication

Last updated

Design an enterprise file storage service covering resumable chunked uploads, metadata/blob separation, versioning, and inherited permissions.

Scenario

You are designing an enterprise document storage and collaboration product (think a hosted drive for companies). End users upload, organize, version, and share files inside deeply nested folder trees. Tenant administrators need fine-grained permissions and a complete audit trail.

Requirements

Functional

  • Upload, download, overwrite, and delete files ranging from 1 KB to 10 GB.
  • Arbitrary folder hierarchies with rename/move of files and folders, plus tag-based search.
  • Version history: every overwrite keeps the prior content, and users can roll back.
  • Role-based sharing (Owner / Editor / Viewer) granted at file or folder granularity, inherited down the tree.

Non-functional

  • 11 nines of durability for file bytes.
  • 99.99% availability for both metadata and blob reads.
  • p95 under 50 ms for metadata operations such as listing a directory.
  • Large uploads must resume after a network drop without re-sending already-transferred bytes.

Scale

  • 50M monthly active users, 10M daily active users.
  • 2B files today, +20M files/day, average 2 MB with a tail to 10 GB.
  • Metadata read:write ≈ 10:1; blob download:upload ≈ 5:1.

What to Cover

  1. API design, including the resumable upload handshake.
  2. Storage architecture: separating metadata from blob storage, chunking, deduplication.
  3. Data model for the tree, versions, chunks, and permission inheritance.
  4. Consistency and integrity: concurrent writes, atomic metadata updates, garbage collection.

Hints

Hint 1

Estimate metadata QPS and blob throughput first — they have wildly different shapes and should not share a storage layer.

Hint 2

Make the upload API return the list of chunk hashes the server is missing; that single trick gives you resume and deduplication at once.

Hint 3

For inherited permissions, store the chain of ancestor IDs on each node so a permission check is one indexed query instead of a recursive walk.