KatInterview

Build a Scalable Chunk-Based Storage Deduplication System

System DesignModel answer
HardModel answerSystem Designdistributed-systemsstoragescalability

Last updated

Design an enterprise-grade deduplication storage service handling petabyte-scale data with content-addressed chunking, distributed indexing, and safe garbage collection.

You're tasked with architecting a storage service that eliminates duplicate data across large file repositories. The system must handle petabyte-scale workloads efficiently.

Your design should cover:

Core Architecture:

  • How files are broken down, stored, and reconstructed
  • Index and metadata organization
  • API surface for upload, retrieval, and deletion operations
  • Request flows for both storing and fetching data

Operational Robustness:

  • Ensuring data consistency when operations fail or retry
  • Safe removal of unused storage without risking data loss
  • Handling corrupted or lost data
  • Index partitioning and redistribution strategies
  • Rolling out changes without downtime

Production Concerns:

  • Observability: what metrics and alerts matter
  • Cost management across compute, storage, and bandwidth
  • Capacity forecasting approach
  • Security and regulatory compliance (encryption, access controls, data residency)
  • Protecting live traffic during maintenance operations

Think through the trade-offs at each layer. Where would you optimize for durability versus latency? How do you balance deduplication efficiency against complexity? What failure modes keep you up at night?

Hints

Hint 1

Break files into variable-size blocks using content-aware boundaries—this maximizes deduplication when files are edited

Hint 2

Don't rely on reference counting for cleanup in distributed systems; consider time-based marking approaches instead

Hint 3

The index needs to answer 'do we have this chunk?' at high throughput—think about how to shard and cache effectively