Pastebin System Design
Let people store text snippets and share them by link.
About this problem
Design a Pastebin-style service for sharing text. Someone pastes a snippet, such as code, logs or notes, and gets back a unique link. Anyone with the link can open and read the paste.
A paste is immutable: once it's created, its content never changes. Every link must keep working and keep showing exactly what was pasted.
There are about 4 views for every new paste, and traffic rises and falls in waves through the day, between roughly 500 and 1,500 requests per second.
Requirements
- Create a paste and get back a unique link.
- Anyone with the link can view the paste.
- Pastes are immutable once created.
Scale targets
- About 4 views for every new paste.
- Traffic rises and falls in waves through the day.
Traffic
Steady wave, 500 to 1,500 TPS. The simulator sets this traffic up for you when you start the problem.
CAP trade-off
Pastes never change after they're created, so any copy of one is correct. Keeping every link readable matters more than strict coordination.
Practice it
Build it on the canvas, run the traffic, and get scored.
Related problems
- URL Shortener System Design
Turn long URLs into short codes and redirect visitors fast.
- Photo Sharing (Instagram) System Design
Upload photos and browse a feed of images from people you follow.
- News Feed (Twitter Timeline) System Design
Show each user a timeline of posts from the accounts they follow.