Skip to content

Case study: Pastebin

Design a paste service where the payload, not the request rate, drives the design: metadata in a database, content in an object store, hot pastes in a cache.

30 min9 steps

By the end you can
  • Estimate content and metadata storage separately and size a cache in bytes
  • Split metadata and content across stores and order the writes safely
  • Design expiry, burn-after-read and cleanup without full scans or races
  • Predict the effect of a slow or lossy object store and choose where retries are safe

Requirements

Share immutable text; list/delete owned pastes

  • Expiry and burn-after-read

10 KB typical; 10 MB maximum

  • p99 <200 ms; 99.9% reads; durable acknowledgements

Which clarifying question most changes the storage design?

Answer this step to continue.

What this lesson simplifies

  • The runnable design is one reduced cell at about 2,000 requests/s; storage totals are discussed, not simulated.
  • The object store is modelled as unlimited concurrency with a latency distribution; real stores also throttle per prefix.
  • Burn-after-read and expiry are discussed in the text; the simulator does not expire records.

Sources

  1. Amazon Web Services. Amazon S3 FAQs (durability and storage classes).
  2. R. Fielding, M. Nottingham, J. Reschke. HTTP Semantics (RFC 9110), 2022.
  3. M. Brooker. Exponential Backoff And Jitter, 2015.

Reviewed by Content lead on . Revision 1.