KatInterview

Architecting a Durable, Always-On Object Store at Scale

System DesignModel answer
MediumModel answerSystem Designobject-storagedistributed-systemsreplication

Last updated

Design a horizontally scalable object storage service with buckets, keys, and huge blobs, covering metadata, placement, durability, consistency, large uploads, security and operations.

Build a cloud object store

Imagine you are asked to design a cloud-scale object storage service in the spirit of a public cloud's bucket-and-key offering. Customers group data into named containers (buckets) and save binary objects of any size under string keys. The service must hold billions of objects, stay reachable through hardware and facility failures, and almost never lose data.

What the service should offer

  • Create and remove buckets.
  • Upload an object, download it (whole or a byte range), fetch its metadata only, and delete it.
  • List the objects in a bucket, optionally filtered by key prefix, with pagination.
  • Handle very large objects efficiently.

Qualities to address

  • Scale to billions of objects and very high request rates.
  • High availability, including surviving the loss of an entire data center zone.
  • Extremely high durability.
  • Reasonable latency for small objects and high throughput for large ones.

Topics your answer should cover

  1. Requirements and a rough sizing estimate.
  2. The external API.
  3. Data model for buckets, objects, metadata, and where the bytes physically live.
  4. Overall architecture: request tier, metadata layer, storage nodes, background workers.
  5. How data and metadata are partitioned and how requests are routed.
  6. Durability and failure handling: replication or erasure coding, failure domains, repair.
  7. Consistency guarantees and the step-by-step flow of a write and a read.
  8. Large-object handling: multipart upload, resumability, range reads.
  9. Security: authentication, authorization, encryption in transit and at rest.
  10. Monitoring, key metrics, and capacity planning.

Walk through an upload and a download end to end, point out the major trade-offs, and justify each decision.

Hints

Hint 1

Begin with numbers: object count times average size gives logical capacity, erasure-coding overhead gives raw capacity, and per-object metadata size tells you whether metadata fits on one machine.

Hint 2

Keep metadata (small, hot, transactional) separate from data (large, immutable, written once) so each can be scaled, stored, and tuned on its own terms.

Hint 3

Think in failure domains (disk, host, rack, zone). Spread replicas or erasure-coded fragments so that losing a whole zone is survivable, and reason about how fast repair is, since that drives durability.

Hint 4

Make the metadata commit the single point where an object becomes visible; that gives you read-after-write consistency for a key and clean handling of failed uploads (orphan data is garbage-collected).