KatInterview

Build a Blob Storage Platform with Resumable Large Uploads

System DesignModel answer
MediumModel answerSystem Designobject-storagemultipart-uploadreplication

Last updated

Design a cloud blob store that accepts huge files in parts, keeps them durable across machine and site failures, and scales to petabytes with heavy concurrent traffic.

Design a managed blob storage service, comparable to a public cloud object store, where customers can store and fetch files ranging from a few bytes to several terabytes.

Begin by stating your assumptions: peak request rates, typical and maximum object sizes, total data volume, durability and availability goals, and the consistency you promise. Then cover the areas below.

  1. Client-facing API

    • Sketch REST endpoints to write, read, inspect, delete and list objects, where an object is identified by a container (bucket) plus a key.
    • Explain how requests are authenticated and how per-object metadata (size, content type, custom attributes) is handled.
  2. Large-file uploads

    • Describe how a multi-gigabyte file is broken into parts and sent.
    • Explain how progress is tracked, how a failed part is retried, and how the parts become one final object.
    • Discuss the effect of part size and how integrity is verified (checksums).
  3. Storage layout and replication

    • Separate the design of the data layer from the metadata layer, and say what each stores.
    • Explain how data survives disk, machine and whole-site failures (replication versus erasure coding).
    • State your consistency model for reading data just after writing it.
  4. Failure handling and disaster recovery

    • What happens when an entire data center is lost? How are failures detected, how is traffic redirected, and how do reads and writes continue?
    • How do backups and restores work, and how do you keep data loss at or near zero in a catastrophe?
  5. Scale and performance

    • How do you support very high request rates and petabyte-scale storage?
    • Cover partitioning/sharding, load balancing and caching.

Finish by walking through one complete upload and one complete download from the client's perspective down to the disks.

Hints

Hint 1

Keep data and metadata apart: the bytes are large and never change once written, while the metadata is small and needs transactional updates. Make the metadata commit the single point at which an object becomes visible.

Hint 2

For multipart uploads, make each part idempotent by part number, let the client list already-stored parts to resume, and have the 'complete' step stitch together references to existing chunks instead of copying bytes.

Hint 3

Compare 3x replication with erasure coding such as 8 data + 4 parity fragments spread over three zones. Compute the storage overhead and check that losing one zone still leaves enough fragments to rebuild data.

Hint 4

Remember background machinery: repair of lost fragments, a scrubber that detects bit rot, garbage collection of orphaned data from failed uploads, and cross-region replication for region-level disasters.