Requirements
Functional 1. Users should be able to upload or paste their data and get a unique URL. 2. Only text data 3. Liks will have a expiry date. 4. Custom alias Non Functional 1. Highly reliable 2. Highlt Available 3. Realtime with low latency 4. Links should not be guessable. Extended: 1. Analytics 2. Rest api service.
Design Considerations
2. URL size limit
Capacity estimation
Storage estimation
API
addPaste(key, data, custom_url, user, paste, expiry_date)
deletePaste(key, url)
HLD
I would use a key value store with consistent hashing. He has written two databases, one for metadata and one for pastes, but I don’t think it is good.
Application Layer
2. Duplicates and collision
Datastore Layer