Case Study 37 โ€” Exabyte-Scale Object Storage

Design an S3-compatible object storage system at exabyte scale: store trillions of objects across millions of disks, survive rack/datacenter failures, serve GET/PUT with 11 nines durability, and support lifecycle policies โ€” explaining erasure coding, metadata partitioning, and request routing internals.

Want the real-world story of how Amazon does this? Read Case Study 41 โ€” Amazon S3 Internals (heat management, ShardStore, EC, public scale numbers).

1. Problem

Applications store photos, backups, logs, and ML datasets as opaque blobs addressed by bucket + key. Unlike a filesystem, objects are immutable versions (overwrite = new version), metadata is separate from bytes, and the system must:

  1. Durably persist exabytes on commodity hardware with frequent disk/rack failures
  2. Route a request to the right partition among millions of storage nodes
  3. Balance replication vs erasure coding for cost
  4. Enforce lifecycle (IA โ†’ Glacier โ†’ delete) without blocking hot paths

The hard part is not storing one object โ€” it is metadata at trillion-object scale and reconstruction under correlated failures while keeping PUT/GET tail latency bounded.

2. Requirements

Functional (MVP)

  • S3-like API: CreateBucket, PutObject, GetObject, DeleteObject, ListObjectsV2 (prefix)
  • Strong read-after-write for new objects in a bucket (after PUT success)
  • Versioning optional per bucket
  • Multipart upload for large objects (> 5 GB)
  • Lifecycle rules: transition storage class after N days; expire objects
  • Storage classes: Standard (hot), Infrequent Access, Archive (async retrieval)

Out of scope (initially)

  • POSIX filesystem mount (EFS-like)
  • Cross-region active-active writes (CRR async replication is stretch)
  • Object locking / legal hold (compliance add-on)
  • User-facing SQL query (Athena-style separate service)

Non-functional

  • Durability 99.999999999% (11 nines) per object over a year
  • Availability 99.99% for Standard class reads
  • GET p99 latency < 100 ms for hot objects (excluding first-byte from archive)
  • PUT throughput: sustain millions of PUT/s globally (aggregate)
  • Scale: 1 EB logical data, 100B+ objects, 10k+ storage nodes
  • Blast radius: single rack loss must not lose data; AZ loss survivable with EC

3. Back-of-the-envelope

These numbers are rough order-of-magnitude math โ€” not an S3 capacity contract. In interviews, the goal is to show you know what to count and which resource breaks first. A useful shortcut: 1 QPS sustained โ‰ˆ 86,400 requests/day (86,400 seconds in a day). Exabyte object storage is read-heavy at massive scale โ€” the surprise is that metadata, not disk bytes, is usually the scaling bottleneck.

Why we estimate

At exabyte scale, you cannot treat object storage like a big filesystem. Estimates tell us:

  • Why 3ร— replication for all data is cost-prohibitive โ†’ erasure coding
  • Whether metadata indexing or PUT throughput breaks first
  • How many disks and storage nodes the fleet actually requires

Assumptions

AssumptionValueWhy it matters
Total objects100BMetadata index must shard at trillion scale
Average object size10 MBBlended (many small, some large multipart)
Logical data1 EBHeadline scale target
PUT rate (global avg)500K/sIngest from apps, logs, ML pipelines
GET rate (global avg)10M/sRead-heavy โ€” CDN origin, analytics, ML training
Metadata per object1 KBKey, version, checksum, shard locations
Erasure coding10+4 (1.4ร— overhead)vs 3ร— replication = 3.0ร— overhead
Drive size12 TBCommodity HDD class

Step A โ€” Traffic (QPS / throughput) with labeled arithmetic

PUT rate:

Avg PUT QPS       = 500,000 objects/second
Peak PUT QPS      โ‰ˆ 2,000,000 objects/second (ร—4 burst)

GET rate (read-heavy โ€” 20:1 over PUT):

Avg GET QPS       = 10,000,000 objects/second
  CDN absorbs much client traffic; origin still sees millions/s

PUT ingest bandwidth:

Avg: 500K PUT/s ร— 10 MB โ‰ˆ 5 TB/s global ingest
Peak: 2M PUT/s ร— 10 MB โ‰ˆ 20 TB/s
  โ†’ Wide striping across many independent partition writers

GET egress bandwidth:

10M GET/s ร— 10 MB โ‰ˆ 100 TB/s theoretical max
  โ†’ Most served from CDN/edge cache; origin GET is lower but still enormous

Step B โ€” Storage

Logical data (user-visible):

100B objects ร— 10 MB โ‰ˆ 1 EB raw logical data

With 3ร— replication (too expensive at this scale):

1 EB ร— 3 โ‰ˆ 3 EB disk โ€” cost-prohibitive for all data

With erasure coding (10+4, 1.4ร— overhead):

1 EB ร— 1.4 โ‰ˆ 1.4 EB on disk + parity reconstruction CPU on failure
  Standard class: EC for data; replication for metadata and hot tail

Metadata storage (the hidden giant):

100B objects ร— 1 KB metadata โ‰ˆ 100 PB of metadata
  โ†’ Must shard aggressively โ€” metadata is the scaling bottleneck, not disk bytes

Disk count:

1.4 EB รท 12 TB per drive โ‰ˆ 117,000 drives minimum
With system overhead (spares, filesystem, rebalance headroom) โ†’ ~150,000 drives
Across 10K+ storage nodes โ†’ ~15 drives per node average (many more in practice)

Step C โ€” Bandwidth / other

ListObjects hot prefix problem:

A single prefix with 1M keys โ†’ pagination mandatory
  Cannot full-scan; need indexed prefix metadata or separate listing service

Durability math (11 nines):

99.999999999% โ†’ ~1 object lost per 10B objects per year
  Requires continuous scrubbing + repair + EC reconstruction on disk failure
  At 150K drives, dozens of drives fail daily โ€” background fleet must keep up

Multipart upload (large objects > 5 GB):

A 100 GB object โ†’ 10K parts ร— 10 MB
  Metadata tracks part list; commit on CompleteMultipartUpload

Step D โ€” Ratios and capacity table

MetricAveragePeakNotes
PUT QPS500K/s2M/sIngest path
GET QPS10M/sโ€”20:1 read:write
PUT bandwidth~5 TB/s~20 TB/sWide striping required
Logical data1 EBโ€”100B ร— 10 MB
EC disk (1.4ร—)1.4 EBโ€”vs 3 EB with 3ร— replication
Metadata~100 PBโ€”100B ร— 1 KB โ€” the bottleneck
Drive count~150Kโ€”12 TB drives + overhead

What the numbers tell us

  • 100 PB metadata >> 1 EB data in management complexity โ†’ shard metadata service aggressively
  • 3ร— replication for 1 EB = 3 EB disk โ†’ cost-prohibitive; erasure coding (1.4ร—) for Standard class
  • 500K PUT/s, 10M GET/s โ†’ GET dominates; CDN + edge cache in front of origin
  • ~150K drives, dozens fail daily โ†’ background repair fleet is as important as the front tier
  • ListObjects on hot prefix โ†’ indexed prefix metadata, not brute-force scan
  • 11 nines durability โ†’ continuous scrub + EC reconstruction; not "set and forget" replication

Common mistake for this problem

Using 3ร— replication for all exabyte data โ€” at 1 EB logical, that's 3 EB of disk and ruinous cost. Interviewers want erasure coding (10+4) for Standard class with replication reserved for metadata and small hot objects. Another mistake: assuming disk bytes are the bottleneck โ€” at 100B objects, the metadata index (100 PB) and request routing to the right partition dominate design.

4. High-Level Design (HLD)

PUT / GET path

Components

ComponentRole
API GatewayAuth (SigV4), bucket policy, rate limits
Request RouterConsistent hash: (bucket, key) โ†’ partition
Partition ServerOwns object metadata shard; coordinates EC writes/reads
Metadata IndexPer-partition B-tree / LSM: key โ†’ version โ†’ shard map
Storage NodeLocal disk chunks; heartbeat to cluster manager
Erasure EngineReed-Solomon encode/decode; shard placement
Cluster ManagerDetect failed nodes; trigger rebuild; balance
Lifecycle WorkerScan metadata for transitions/expiry; enqueue re-tier jobs

Erasure coding vs replication

3-way replication:
  Overhead 3ร—; rebuild = copy from any replica; simple; good for small/metadata

10+4 Reed-Solomon (n=14, k=10):
  Overhead 1.4ร—; tolerate 4 shard losses; rebuild reads 10 shards + CPU
  Standard for large objects (> 1 MB typically)

Hybrid policy:
  Objects < 128 KB: replicate 3ร— (EC overhead not worth it)
  Objects โ‰ฅ 128 KB: EC 10+4
  Metadata records: 3ร— replicated on Paxos/Raft group (small, hot)

Metadata partitioning strategy

Level 1 โ€” Bucket registry (global, replicated):
  bucket_name โ†’ bucket_id, owner, region, storage_class_defaults

Level 2 โ€” Object partition (hash bucket_id + key_prefix):
  partition_id = hash(bucket_id, key) mod NUM_PARTITIONS
  Each partition server holds LSM of object keys in range

Level 3 โ€” Blob location (within partition metadata):
  version_id โ†’ { size, etag, ec_scheme, shard_locations[], storage_class, ttl }

NUM_PARTITIONS scales with object count (e.g. 1M partitions ร— 100k objects each)

Trade-offs

ChoiceProsCons
Hash partition by keyEven spreadListObjects needs prefix indexes
Partition by bucket onlyEasy listingHot buckets saturate one server
LSM metadata storeFast writesCompaction spikes; tuning needed
Separate blob storeClean separationTwo-phase commit complexity
Sync EC all shards before ACKStrong durabilityHigher PUT latency
Async EC (replicate then encode)Faster PUTWindow of higher risk

5. Low-Level Design (LLD)

APIs (S3-compatible subset)

PUT /{bucket}/{key}
Headers: Content-Length, Content-MD5, x-amz-storage-class: STANDARD|IA|GLACIER
โ†’ 200 { ETag, VersionId }

GET /{bucket}/{key}?versionId=
โ†’ 200 stream + Content-Length, ETag
โ†’ 404 NoSuchKey

DELETE /{bucket}/{key}
โ†’ 204 (tombstone version or delete marker)

POST /{bucket}?uploads
โ†’ { UploadId }

PUT /{bucket}/{key}?partNumber=N&uploadId=U
โ†’ { ETag }

POST /{bucket}/{key}?uploadId=U  (CompleteMultipartUpload)
Body: XML list of parts
โ†’ { VersionId, ETag }

GET /{bucket}?list-type=2&prefix=logs/2024/&continuation-token=
โ†’ { Contents[], IsTruncated, NextContinuationToken }

PUT /{bucket}?lifecycle
Body: { rules: [{ prefix, transitionDays, expireDays }] }

Schema

Bucket registry (Raft group / Spanner)

buckets (
  bucket_id        UUID PRIMARY KEY,
  bucket_name      TEXT UNIQUE,
  owner_account    TEXT,
  region           TEXT,
  versioning       ENUM('off','on'),
  created_at       TIMESTAMP
)

bucket_lifecycle_rules (
  bucket_id        UUID,
  rule_id          UUID,
  prefix           TEXT,
  transition_days  INT,
  target_class     TEXT,
  expire_days      INT,
  PRIMARY KEY (bucket_id, rule_id)
)

Object metadata (per partition โ€” RocksDB / Cassandra)

object_index (
  partition_key    (bucket_id, object_key_hash),
  object_key       TEXT,
  version_id       UUID,
  size_bytes       BIGINT,
  etag             TEXT,
  storage_class    TEXT,
  created_at       TIMESTAMP,
  delete_marker    BOOLEAN,
  shard_map        BLOB,  -- compressed [{node_id, shard_idx, checksum}]
  PRIMARY KEY ((partition_key), object_key, version_id)
)

multipart_uploads (
  upload_id        UUID PRIMARY KEY,
  bucket_id        UUID,
  object_key       TEXT,
  parts            MAP<INT, PART_META>,
  initiated_at     TIMESTAMP
)

Prefix listing index (optional secondary)

prefix_index (
  bucket_id        UUID,
  prefix_hash      BIGINT,
  object_key       TEXT,
  version_id       UUID,
  PRIMARY KEY ((bucket_id, prefix_hash), object_key)
)
-- maintained async on PUT/DELETE; eventually consistent for list

Storage node local

shards (
  shard_id         UUID PRIMARY KEY,
  object_version   UUID,
  shard_index      SMALLINT,
  disk_path        TEXT,
  checksum         TEXT,
  state            ENUM('active','rebuilding','deleting')
)

Modules

S3ApiHandler
AuthPolicyEngine (SigV4, bucket ACL)
PartitionRouter
PartitionServer
  โ”œโ”€โ”€ MetadataStore (LSM)
  โ”œโ”€โ”€ BlobCoordinator
  โ””โ”€โ”€ ListIndexBuilder
ErasureCodec (ReedSolomon 10+4)
ShardPlacementPolicy (rack/ AZ aware)
RebuilderWorker
LifecycleScanner
ClusterManager (failure detection, rebalancing)

Algorithm โ€” PUT object (EC path)

function putObject(bucket, key, body, storageClass):
  partition = router.resolve(bucket, key)
  versionId = uuid()
  size = body.length

  if size < SMALL_OBJECT_THRESHOLD:
    return putReplicatedSmallObject(partition, bucket, key, body, versionId)

  shards = erasure.encode(body, k=10, m=4)  // 14 shards
  placements = placementPolicy.assign(shards, excludeFailedNodes=true)
  // placements respect: unique racks, max 1 shard per node per object

  metadata = ObjectMeta(versionId, size, pending=true, shard_map=placements)

  metadataStore.insertPending(partition, bucket, key, metadata)

  acks = 0
  for each (shard, node) in placements:
    futures.add(node.writeShard(shard_id, shard.data))
  wait until acks >= 10 OR timeout

  if acks < 10:
    metadataStore.markAborted(versionId)
    enqueueGarbageCollect(shards)
    fail(503)

  metadataStore.commit(partition, bucket, key, versionId)
  return { etag: md5(body), versionId }

Algorithm โ€” GET object (degraded read)

function getObject(bucket, key, versionId):
  meta = metadataStore.getLatest(bucket, key, versionId)
  if meta.delete_marker: return 404

  shardMap = meta.shard_map
  liveShards = selectReadableShards(shardMap, min=10)

  if liveShards.count >= meta.k:
    data = erasure.decode(liveShards)
    return stream(data)

  if liveShards.count >= meta.k but includes rebuilding:
    triggerPriorityRebuild(meta)
    data = erasure.decode(liveShards)
    return stream(data)

  fail(503)  // insufficient shards

Algorithm โ€” shard placement (fault domain aware)

function assignShards(encodedShards[14], topology):
  candidates = storageNodes.filter(healthy, freeDisk > shardSize)
  shuffle(candidates)
  usedRacks = set()
  placements = []

  for shard in encodedShards:
    node = pick candidates where node.rack not in usedRacks OR relax if stuck
    placements.append((shard, node))
    usedRacks.add(node.rack)
  return placements

Algorithm โ€” rebuild on node failure

function onNodeFailure(failedNode):
  affectedShards = catalog.shardsOn(failedNode)
  for shard in affectedShards:
    objectMeta = metadata.lookup(shard.object_version)
    siblingShards = readShards(objectMeta, exclude=failedNode, count=10)
    rebuilt = erasure.decode(siblingShards)
    newShard = erasure.extractShard(rebuilt, shard.index)
    targetNode = placementPolicy.pickReplacement(failedNode.rack)
    targetNode.writeShard(shard.id, newShard)
    metadata.updateLocation(shard.id, targetNode)
  mark failedNode draining; rebalance if needed

Algorithm โ€” lifecycle transition

function lifecycleScannerLoop():
  for partition in ownedPartitions:
    for meta in metadata.scan(storageClass=STANDARD, age > rule.transitionDays):
      if meta.accessPattern.lastRead < 30d:
        enqueueTransition(meta, targetClass=IA)

function transitionWorker(job):
  // IA may use same EC layout; GLACIER = re-pack to tape/cold tier
  coldLocation = coldTier.write(fetchObject(job.versionId))
  metadata.updateStorageClass(job.versionId, GLACIER, coldLocation)
  optionally delete hot shards after verify

ListObjectsV2 (prefix pagination)

function listObjectsV2(bucket, prefix, token, maxKeys=1000):
  prefixHash = hashPrefix(bucket, prefix)
  startKey = decodeToken(token)  // last object_key from previous page
  rows = prefixIndex.query(bucket, prefixHash, startKey, limit=maxKeys+1)
  truncated = len(rows) > maxKeys
  return { Contents: rows[:maxKeys], IsTruncated: truncated, NextToken: ... }

Concurrency & correctness

  • Compare-and-swap on metadata: PUT with If-None-Match: * for create-only semantics
  • Versioning: DELETE creates delete marker; GET without versionId returns latest non-marker
  • Multipart: complete only if all parts present; idempotent complete with same part ETags
  • Split-brain prevention: partition ownership via Raft epoch; stale owners reject writes
  • Read-after-write: commit metadata only after EC quorum durable (fsync on storage nodes)

6. Scale evolution

StageData scaleDesign
MVP100 TBSingle region; 3ร— replication; Postgres metadata; nginx + minio-style nodes
Growth10 PBPartition metadata; introduce EC for objects > 1 MB; dedicated router tier
Large100 PB1M+ partitions; separate list index; async lifecycle workers
Exabyte1 EBGlobal namespace; per-region clusters; cross-region async replication (CRR)
Metadata pressure100B objectsHierarchical keys; bloom filters per partition; garbage collect tombstones in background
Hot bucketviral objectCDN in front; optional per-object replication boost; rate limit LIST on prefix

7. Recap

  • Bytes are cheap to spread; metadata is hard โ€” partition by hash(bucket, key), secondary index for prefix listing
  • Erasure coding (10+4) makes exabyte economics work; replication reserved for tiny objects and control metadata
  • PUT quorum = k shards before commit; rebuild is normal operations, not emergency
  • Lifecycle and tiering are metadata-driven background jobs โ€” never block the hot GET/PUT path
  • Blast-radius placement (rack/AZ diversity) matters more than raw disk count

Practice: walk through losing 4 storage nodes simultaneously in one rack โ€” how many objects become unreadable, and what rebuild pipeline steps restore 11-nines durability?