KatInterview

Storage System for Compiled Build Outputs

System DesignModel answer
HardModel answerSystem Designdistributed-systemsstoragescalability

Last updated

Design a scalable distributed storage service that handles immutable binary files produced by continuous integration pipelines.

You need to design a distributed storage service that handles the binary outputs of compilation and packaging steps in a continuous integration system. These outputs—executables, container images, compressed archives, and similar files—are produced by build machines and later retrieved by testing infrastructure, deployment tools, and release processes.

The service shares characteristics with distributed databases but differs in two key ways: stored items are opaque binary blobs rather than structured records, and you can relax some consistency guarantees that databases maintain.

Your design should address:

  • The client-facing API for storing and retrieving items
  • How blobs and their associated metadata are organized and located
  • Durability mechanisms including replication strategy
  • Scaling approaches for both write and read traffic
  • Which consistency properties you maintain and which you deliberately weaken, with justification

Consider practical concerns like upload verification, handling popular items that many clients request simultaneously, retention policies, and reclaiming space from obsolete items.

Before diving into the design, clarify assumptions about scale (daily upload volume and file size distribution), access patterns (who reads what, and when), mutability (are stored items permanent or can they be replaced), retention requirements, lookup mechanisms (content-based vs. metadata-based), geographic distribution, and whether you're building the entire storage stack or can use existing infrastructure as a foundation.

Hints

Hint 1

Separate the concerns of storing large immutable blobs from tracking mutable metadata about those blobs

Hint 2

Think about what happens when thousands of test machines all need to download the same newly-built binary at once

Hint 3

Consider how to make an item atomically visible only after all its bytes are safely stored and validated