Medium · 11 steps · ~60 min
Design object storage (S3-like) and pastebin
Start with a pastebin, grow it into a durable store for files of any size.
You begin with a pastebin: paste text, share a link. Then people want to upload photos, videos and backups. The service has to store bytes for years without losing any, serve popular files quickly, and keep the bill under control.
Same problem as Amazon S3PastebinGoogle Cloud Storage
How it works
- Write: create an object or upload a big file in parts (rare, large).
- Read: fetch by key, often the same popular objects (read-heavy).
- Keep: never lose a byte, even when disks and servers die.
What you'll build
- The API and the metadata-versus-blob data model
- A cached metadata path for a viral paste
- Object storage for bytes, with a CDN for reads
- Replication for metadata, and designs that survive a cold CDN, a lost storage node and a lost primary
Steps
- 1Design the API
- 2Design the data model
- 3A pastebin that works
- 4A viral paste
- 5Why split metadata from blobs?
- 6Add large files and a CDN
- 7Durability: what does eleven nines mean?
- 8Survive a cold CDN
- 9Lose a blob storage node
- 10Lose the metadata primary
- 11Deep dive: big uploads