Infrastructure primitives
Object storage - eleven nines from cheap disks
How objects are split, erasure-coded and placed across failure domains so losing disks never loses data.
What this board gets wrong on purpose
The tension
RS(9,6) stores 1.67 bytes per byte instead of 3 and survives a zone loss plus one more disk, but every saving is paid elsewhere. Rebuilding one lost fragment reads nine others, so a dead 20 TB disk costs about 144 TB of cross-rack network to repair, and repair speed IS durability - halve it and the loss probability rises by orders of magnitude. Every PUT writes fifteen fragments across three zones, so writes pay cross-zone latency and transfer, and with a zone down every read of its objects needs nine fragments from the other two, turning a 20 ms GET into a reconstruction over the zone links. Small objects cannot be split fifteen ways sensibly, so they are packed into 256 MB volumes, which turns DELETE into garbage plus a compaction job that rewrites whole volumes and costs I/O forever. The metadata index is the single point where an object exists or does not - it gives strong read-after-write and list-after-write, and it is also the scaling ceiling: 50 billion rows, hot key prefixes that must be split under load, and an outage there makes every byte unreachable however many disks are healthy. And the eleven nines are a model that assumes independent failures; a buggy release that deletes fragments or a firmware batch that dies together beats any code, and only versioning, object lock and delayed garbage collection defend against that - at the cost of storing deleted data for days.
Practise this as an interview
Take Object storage - eleven nines from cheap disks as a timed system design interview on a blank board - on your own, with the requirements to check yourself against, or with a candidate you invite.
Start here
Why this design
S3, Google Cloud Storage, Azure Blob, Ceph RGW and MinIO all sell the same promise - put bytes under a key, get them back, never lose them - and all keep it the same way: separate the small, strongly consistent metadata (which keys exist, where their pieces are) from the enormous, append-mostly data, then cut the data into fragments with an erasure code and spread them so no single failure takes enough. The interview question "design S3" is answered well by someone who can do the durability arithmetic, explain why repair speed matters more than the code, and say what the metadata tier costs.
What you will learn
- Why 3x replication and RS(9,6) survive the same zone-plus-disk failure, at 3x and 1.67x the data.
- How placement spreads 15 fragments over 3 zones and 15 racks, and why that rule matters more than the code.
- The durability arithmetic: about 11 nines for 3 copies with a 6-hour repair, about 26 for RS(9,6) - and why nobody believes either.
- Why the manifest write is the commit point, and how that gives strong read-after-write.
- Scrubbing, prioritised repair, and why rebuilding one fragment reads nine.
- Why small objects are packed into volumes, and what that does to DELETE.
- The sizing: 100 PB logical, 50 billion objects, about 10,400 disks instead of 18,750, and four disk failures a week.
How to read this board
- Press play: eight steps follow one 24 MB upload into fifteen fragments, then a disk failure and its repair, then a small object.
- ENTRY: the application, the API front end, and versioning - the defence against bugs rather than disks.
- METADATA: the index that decides whether an object exists, its key-range partitions, and lifecycle.
- DATA: the erasure coder, the placement decision, the small-object packer, and three zones - the red one has lost a disk.
- KEEPING ELEVEN NINES: scrubber, repair queue, rebuilder, garbage collector.
- Pages 1 to 6, then the DATA MODEL.
1 · Requirements
Ask these before drawing anything
- What durability is promised, and per what? "Eleven nines per object per year" means an expected loss of one object in a hundred billion per year. Write it down; every other number follows from it.
- Must the store survive a whole zone? If yes, every write crosses zones and the code must be chosen so one zone holds no more fragments than the code can lose.
- What is the size distribution? Median objects in most buckets are under 100 KB while most BYTES are in objects over 10 MB. The small ones decide request costs and the large ones decide disk costs.
- Is read-after-write consistency required, and for LIST too? It decides how the metadata tier is built.
- What is the read pattern? Write once, read rarely (backups) wants cold encodings; hot media wants caches in front.
- Is deletion legally required to be prompt? It conflicts with delayed garbage collection, which is a safety net.
Functional
- PUT, GET (including byte ranges), HEAD, DELETE, and LIST by prefix with pagination.
- Multipart upload for objects up to 5 TB in parts of 5 MB to 5 GB.
- Versioning, delete markers, and object lock (write once, read many) per bucket.
- Lifecycle rules: move to a cold tier after N days, expire after M.
- Strong read-after-write and list-after-write consistency.
Non-functional
- 99.999999999 percent annual durability per object; 99.99 percent availability.
- Survive the loss of one availability zone with no data loss and continued reads and writes.
- GET first byte p99 under 100 ms for hot objects; PUT p99 under 200 ms for 1 MB.
- 1,000,000 GET/s and 100,000 PUT/s across the region.
- Storage cost: under 1.7 raw bytes per logical byte for objects over 1 MB.
Out of scope
- POSIX semantics - rename, append, partial overwrite. An object is replaced whole.
- Cross-region replication (it is an asynchronous copy job on top of this design).
- A CDN; caching in front of GET is a separate tier.
The rest of this board
Available on Tier Slate
This page publishes the question. The answer — 5 more written pages, an 8-step narrated walkthrough and a 6-table schema — is the board itself, and it opens in Tierslate.
- 5written pages
- 8walkthrough steps
- 6tables43 columns
5 pages behind this one
- Capacity estimation
- Storage estimation
- Availability
- How it works
- Deployment plan
More boards
The building blocks an interview asks you to build from scratch.
- URL shortener - one write, a million reads
- Distributed cache - the ring, and what a node leaving costs
- Key-value store - quorums, and where the consistency knob sits
- Rate limiter - token bucket, and where the counter lives
- Unique ID generator - 64 bits, and two facts nobody can check
- Web crawler - a frontier, and the trap of crawling forever
- Pastebin - a blob store with a short name
- Load balancer - spreading traffic, and noticing who is dead
- API gateway - one front door for many services
- Login and sessions - who you are, on every request
- Feature flags - a config change that ships like code
- Secrets manager - the one store everything trusts
- DNS - the cache that runs the internet
- Distributed cron - exactly one runner at nine o'clock
- Background job queue - at least once, and the retry that doubles it
- Code execution sandbox - running a stranger's program
- Distributed log - Kafka from the partition up
- Consensus - a leader, a log, and a majority