Chaturmind
LearnDSASystem DesignDevOpsEngineering GrowthBlog
Start learning
Chaturmind

Structured learning paths for engineers who want to go deep. Written by practitioners.

Learn

  • Java
  • DSA
  • System Design
  • Spring Boot
  • AI / ML
  • DevOps
  • Engineering Growth

Company

  • Blog
  • Contact

Legal

  • Privacy Policy
  • Terms of Service

Β© 2026 Chaturmind. All rights reserved.

Built for engineers who want to go deep.


← System Design Interview Playbook

Interview Framework

  • The 6-Step Design Framework
  • HLD Fundamentals Refresher
  • Requirement Gathering Practice
  • Domain Decomposition
  • API Contract Design
  • Data Ownership Model
  • Failure Scenario Walkthroughs
  • Architecture Diagramming
  • Back-of-Envelope Estimation

10 Case Studies

  • Design a URL Shortener
  • Design Twitter / X
  • Design WhatsApp
  • Design Netflix
  • Design a Rate Limiter
  • Design a Search Autocomplete
  • Design a Distributed Cache
  • Design a Notification Service
  • Design Uber / Ride Sharing
  • Design a Distributed File Storage System
  • Design a Distributed Task Scheduler
  • Design a Message Queue System
  • Design an Authentication System at Scale
  • Design a Distributed Logging & Metrics Pipeline
  • Design a Food Delivery Platform
  • Design a Real-Time Analytics Dashboard
  • Design a Monitoring & Alerting System
  • Design Container Orchestration Basics
  • Design a CI/CD Pipeline System
  • Design Service Mesh Basics
  • Design a Centralized Configuration & Secrets System
  • Design a Batch Processing System
  • Design a Data Warehouse / Analytics Storage Layer
  • Design Global Content Delivery
  • Case studies

    πŸ—οΈDesign a URL Shortener
  • πŸ—οΈDesign a Rate Limiter
  • πŸ—οΈDesign Twitter / X
  • πŸ—οΈDesign WhatsApp
  • πŸ—οΈDesign Netflix
  • πŸ—οΈDesign a Distributed Cache
  • πŸ—οΈDesign a Notification Service
  • πŸ—οΈDesign a Search Autocomplete System
  • πŸ—οΈDesign Uber / Ride Sharing
  • πŸ—οΈDesign a Web Crawler
  • πŸ—οΈDesign a Payment System
  • πŸ—οΈDesign a Distributed Lock Service
  • πŸ—οΈDesign a Video Streaming Platform
  • πŸ—οΈDesign a Search Engine
  • πŸ—οΈDesign E-Commerce Checkout & Inventory at Scale
Chaturmind
← System Design Interview Playbook

Interview Framework

  • The 6-Step Design Framework
  • HLD Fundamentals Refresher
  • Requirement Gathering Practice
  • Domain Decomposition
  • API Contract Design
  • Data Ownership Model
  • Failure Scenario Walkthroughs
  • Architecture Diagramming
  • Back-of-Envelope Estimation

10 Case Studies

  • Design a URL Shortener
  • Design Twitter / X
  • Design WhatsApp
  • Design Netflix
  • Design a Rate Limiter
  • Design a Search Autocomplete
  • Design a Distributed Cache
  • Design a Notification Service
  • Design Uber / Ride Sharing
  • Design a Distributed File Storage System
  • Design a Distributed Task Scheduler
  • Design a Message Queue System
  • Design an Authentication System at Scale
  • Design a Distributed Logging & Metrics Pipeline
  • Design a Food Delivery Platform
  • Design a Real-Time Analytics Dashboard
  • Design a Monitoring & Alerting System
  • Design Container Orchestration Basics
  • Design a CI/CD Pipeline System
  • Design Service Mesh Basics
  • Design a Centralized Configuration & Secrets System
  • Design a Batch Processing System
  • Design a Data Warehouse / Analytics Storage Layer
  • Design Global Content Delivery
  • Case studies

    πŸ—οΈDesign a URL Shortener
  • πŸ—οΈDesign a Rate Limiter
  • πŸ—οΈDesign Twitter / X
  • πŸ—οΈDesign WhatsApp
  • πŸ—οΈDesign Netflix
  • πŸ—οΈDesign a Distributed Cache
  • πŸ—οΈDesign a Notification Service
  • πŸ—οΈDesign a Search Autocomplete System
  • πŸ—οΈDesign Uber / Ride Sharing
  • πŸ—οΈDesign a Web Crawler
  • πŸ—οΈDesign a Payment System
  • πŸ—οΈDesign a Distributed Lock Service
  • πŸ—οΈDesign a Video Streaming Platform
  • πŸ—οΈDesign a Search Engine
  • πŸ—οΈDesign E-Commerce Checkout & Inventory at Scale
HomeLearnSystem DesignSystem Design Interview Playbook10 Case Studies
βœ“ FreeAdvancedΒ· 11 min read

Design a Distributed File Storage System

A Dropbox/Google Drive-style case study: chunking and dedup, separating metadata from blob storage, delta sync, and last-write-wins vs versioning for offline conflicts.

Published September 23, 2026


Design a Distributed File Storage System

A Dropbox/Google Drive-style problem: upload, download, sync across multiple devices, sharing, and versioning β€” the interesting parts are almost entirely about sync and conflict handling, not the storage itself.

Functional requirements

Upload and download files, sync changes across a user's devices automatically, share files/folders with other users, and maintain version history for recovery from accidental changes or conflicts.

Chunking large files, and deduplication via content hashing

Uploading (or syncing) a large file as one atomic unit is fragile β€” a dropped connection midway means restarting from zero, and even a tiny one-byte edit would otherwise require re-uploading the entire file. The standard fix: split every file into fixed-size chunks (e.g. 4MB each) before upload, tracking each chunk independently.

file.pdf (18MB) β†’ [chunk1: 4MB][chunk2: 4MB][chunk3: 4MB][chunk4: 4MB][chunk5: 2MB]
each chunk identified by SHA-256(chunk content)

Deduplication falls out of content-hashing almost for free: if two chunks (from the same file, a different file, or even a different user's file) hash to the same value, they're byte-for-byte identical β€” the storage backend only needs to store that chunk's content once, with multiple files simply referencing the same chunk hash. This is why cloud storage providers can offer far more effective storage than the sum of every user's raw files would suggest: common files (OS files, popular documents, shared media) frequently produce identical chunks across many unrelated users.

Metadata service, separated from blob storage

[Metadata Service]                    [Blob Storage]
  - file tree (folders, filenames)      - actual chunk bytes, keyed by content hash
  - permissions                         - simple key-value: hash -> bytes
  - chunk-hash list per file version    - horizontally scalable, no knowledge of "files" at all
  - version history

The metadata service (file tree, permissions, which chunk hashes compose which version of which file) is a relatively small, relational-shaped problem β€” well-suited to a strongly-consistent database. Blob storage (the actual chunk bytes) is a much larger-volume, simpler-shaped problem β€” a pure content-addressed key-value store, trivially horizontally scalable, since chunks are immutable and identified purely by their hash (no update-in-place ever needed, only new chunks being added). Separating these lets each be scaled and operated independently, matching its own actual access pattern rather than forcing one storage system to handle both shapes well.

Sync protocol: detecting changes, delta sync

A lightweight watcher on each device monitors the local file system for changes (OS-level file-system-event APIs, not polling). On a detected change, the client re-chunks the modified file and compares the new chunk hashes against the previously-synced version's chunk list β€” only chunks that actually changed get uploaded (delta sync), not the whole file. A one-line edit to a large document might change only one or two 4MB chunks out of dozens β€” delta sync means only those changed chunks cross the network, not the entire file every time.

Conflict resolution: two devices editing offline

The hardest real problem in this system: Device A and Device B both go offline, both edit the same file, then both reconnect. Two strategies:

  • Last-write-wins: whichever edit's sync timestamp is later overwrites the other entirely β€” simple, but silently discards the other device's changes with no recovery path (a real, meaningful data-loss risk for genuinely divergent edits).
  • Versioning (conflict copies): instead of silently picking a winner, the system keeps both versions β€” the classic "filename (conflicted copy from Device B).ext" pattern most sync products actually use. This preserves all data (nothing is silently lost) at the cost of pushing the actual merge decision to the user.

Most production systems default to versioning specifically because silent data loss (last-write-wins) is a far worse failure mode for a storage product than asking the user to manually reconcile two conflicting copies β€” losing data invisibly erodes trust in a way that an extra, mildly annoying file never does.

Notifying other devices of changes

Once a change syncs to the server, other devices need to learn about it to trigger their own sync pull. Two approaches: long-polling (a device holds a request open, the server responds when a change is detected β€” see the WebSocket vs long-polling vs SSE tradeoffs in Design WhatsApp for the general comparison) or a push notification waking the device to trigger a pull. Either way, the actual content transfer still happens via a separate delta-sync pull β€” the notification's only job is telling a device "something changed, go check," not delivering the changed data itself.

Follow-up questions this topic invites β€” and their answers

Q: Why hash chunks instead of hashing the whole file for deduplication? A: Whole-file hashing only deduplicates when two files are 100% byte-identical β€” chunk-level hashing catches the far more common case of two mostly similar files (a document with one paragraph edited, two versions of a codebase) sharing most of their chunks, deduplicating the unchanged portions even when the files as a whole differ.

Q: What happens if two different files legitimately produce the same chunk hash by coincidence (a hash collision)? A: With SHA-256, the probability is astronomically small enough to be considered negligible in practice for this use case β€” production systems generally accept this risk rather than engineering around it, though a maximally paranoid design could verify byte-equality on hash match before actually deduplicating, at the cost of extra I/O on every dedup check.

Q: How does versioning interact with storage cost, given chunks are already deduplicated? A: Efficiently β€” a new version of a file whose edit only changed a couple of chunks only needs to store those new chunk hashes; the unchanged chunks are already in blob storage and get referenced by both the old and new version's metadata, not duplicated. Version history is comparatively cheap precisely because of the same content-addressed dedup that makes cross-user storage efficient.

Q: Why not just re-upload the whole file on every sync and skip delta sync's complexity entirely? A: For large files edited frequently (a shared spreadsheet, a large design file), whole-file re-upload on every small edit would dominate both bandwidth and sync latency β€” delta sync's added complexity (chunk comparison, partial upload) is directly justified by how much smaller a typical incremental change is compared to the whole file, which is the entire reason this pattern exists rather than being over-engineering for its own sake.

Previous

Design Uber / Ride Sharing

Next

Design a Distributed Task Scheduler

AI Tutor

Lesson: Design a Distributed File Storage System

Quick actions

AI responses can be inaccurate. Verify critical information.