High availablility - Pastes should always be readable.
Low read latency - Very high read compared to write.
Read/sec - 200
Write/min - 100
Define the APIs expected from the system. This is your chance to analyze and define the read and write paths so that you can come up with the high-level design...
POST /pastebin/paste
returns URL and TTL
GET /pastebin/url={url}
DELETE /pastebin/url={url}
Describe the overall system architecture. Identify the main components needed to solve the problem end-to-end. Use the diagramming tool to create a block diagram.
Define the data model. Identify the main entities, their attributes, and relationships. Consider the choice of database type (SQL vs NoSQL) and justify your decision based on access patterns...
POST /pastebin/paste
returns URL and TTL
GET /pastebin/url={url}
DELETE /pastebin/url={url}
CleanUp Service monitors TTL and clean up the Redis Cache accordingly.
If two text hits the api at the same time, we will use hash(content+timestamp) to randomize the key.
If clients POST times out, then we use the content hash and ensure that no duplicates are created.