KatInterview

Build a High-Throughput File Storage Backend

System DesignModel answer
HardModel answerSystem Designdistributed-systemsstorageCDN

Last updated

Design a backend system that ingests and serves large files at scale, handling millions of users with high availability and durability guarantees.

You're tasked with architecting a backend system that manages high-volume file operations for a global user base. The service must efficiently ingest large files (up to 50 GB), store them durably, and serve them quickly to users worldwide.

Your design should address:

  • Requirements gathering: Define what the system must do (functional) and how well it must perform (non-functional, including latency, throughput, durability, and availability targets)
  • Capacity estimation: Perform calculations to size the infrastructure—bandwidth needs, storage growth, request volume, and costs
  • API contract: Specify endpoints for upload, download, and metadata operations
  • Architecture: Propose the system's structure, including load distribution, stateless services, storage layers, caching strategy, content delivery, and message queues
  • Scalability: Explain how each component scales horizontally and how to optimize for performance while controlling costs
  • Security: Cover authentication, authorization, encryption (both in transit and at rest), rate limiting, and tenant isolation
  • Reliability: Describe failure handling, retry logic, idempotency guarantees, consistency models, and disaster recovery plans
  • Operations: Outline deployment strategy, observability (logging, metrics, tracing), incident response, and safe rollback procedures
  • Edge cases: Identify and solve challenges like interrupted uploads, duplicate requests, slow clients, and network partitions

Be concrete. Use realistic numbers, make explicit trade-offs, and show how the pieces fit together.

Hints

Hint 1

Start by scoping the problem to a specific use case with concrete scale parameters—avoid designing in the abstract

Hint 2

The control plane (metadata, orchestration) and data plane (byte movement) have different scaling characteristics; consider separating them

Hint 3

CDN hit rates dramatically affect origin load and cost; calculate the impact of a 95% hit rate on bandwidth requirements