SD-3 · PASTEBIN · INTERACTIVEBreak it.
Break it.
Then fix it.
Turn up the readers, watch what melts, and add the parts a real paste service needs. Every switch is a decision you would defend in an interview.
CHALLENGEServe 200K paste reads/s with p99 under 100 ms and no errors.
StatusDOWNAt 50K reads per second
p99 latency500+ msTarget under 100 ms
Errors94%Requests being dropped
Monthly cost$5,470Text on database disks
ReadersLIVE
50K reads/s · 5.0K new pastes/straffic source
Load balancerOK
Autoscales app serversspreading 55K/s
App servers × 16OK
Stateless55K / 80K ops/s
DatabaseDOWN
Rows with 10 KB of text50K reads · 5.0K writes/s
Expiry sweeperOK
Deletes in batchesevery 5 min
Paste text is clogging the database. Every read drags a 10 KB row out of the database, and it grows by 100 GB a day. Keep a small row per paste and put the text in object storage.
98%Bytes that are textMetadata is 200 bytes; the paste is 10 KB. Store them apart.
90%CDN hit rateA paste never changes, so the edge can keep it until it expires.
62⁸Possible keysAbout 218 trillion, so unlisted links cannot be guessed.
404On an expired readChecked on every read, so cleanup can run late.
Want the reasoning behind every switch?Visual walkthroughFull write-up
Was this lab useful?Your vote tells us what to improve next.