KatInterview

Design a Blob Storage Service with Buckets and Keys

System DesignModel answer
MediumModel answerSystem Designstoragedistributed-systemsreplication

Last updated

Design a scalable service where clients store, retrieve, list, and delete binary objects addressed by key inside named buckets.

The Problem

You are asked to design a general-purpose blob storage service. Clients organize their data into named buckets. Within a bucket, each object is an opaque sequence of bytes stored under a string key. Along with the raw bytes, the service tracks a small amount of metadata per object: its size, content type, and a checksum.

The prompt is intentionally open-ended. Before drawing any boxes, you should drive a scoping conversation to pin down the requirements.

Scope the Design First

Work through clarifying questions before proposing anything:

  • Object size distribution — are objects mostly small (thumbnails, config files), mostly large (video, backups), or a wide mix? Is there a hard upper bound on object size?
  • Scale targets — what total data volume should the system hold? What peak read and write rates (requests/sec and bytes/sec)? Single region or multi-region?
  • Durability and availability — what are the SLA targets? (e.g., eleven nines of durability, 99.9% monthly availability)
  • Consistency model — after a successful write, must a subsequent read from any node return the new object? Must a newly written object appear in list results immediately?
  • Feature scope — is overwriting an existing key allowed? Do you need versioning, byte-range reads, multipart upload for large objects, and/or access control?

Your answer will be evaluated on the quality of your scoping, the clarity of your architecture, and your ability to discuss trade-offs — not on hitting a specific "correct" design.

What You Are Expected to Cover

  1. A minimal but complete client-facing API with the semantics of each operation
  2. How the system separates metadata management from raw data storage
  3. How data is placed and protected against hardware failure
  4. The write path end-to-end, including when an object becomes visible to readers
  5. The read path, including range reads and large objects
  6. How multipart uploads work and how very small objects are handled efficiently
  7. Background operations: failure detection, repair, and garbage collection
  8. A rough capacity estimate anchored to the numbers you agreed on in scoping

Hints

Hint 1

Start by splitting the system into two distinct layers: one that maps bucket+key to a physical location (metadata), and one that actually holds the bytes (data nodes). Each layer scales and fails independently.

Hint 2

Think about what 'durable' means in terms of hardware failures. If you replicate, how many copies and across which failure domains? If you use erasure coding instead, what do you gain and give up compared to replication?

Hint 3

A write is not a single atomic step — consider what sequence of operations happens between the client sending bytes and the service returning 200 OK, and at which exact point the object becomes readable by other clients.