Requirements
Functional Requirements:
- Allow users to upload and store text or code snippets.
- Generate a unique shareable URL for each paste.
- Enable retrieval of paste content by URL.
- Support expiration and TTL for pastes.
- Allow paste owners or the system to delete a paste before its natural expiration.
Non-Functional Requirements:
- High availability
- Low-latency
- Scalability
API Design
- GET: /api/{id}, return type: string, which is text and code snippet
- POST /api/delete
- body: id of the paste
- return type: status code
- POST /api/upload
- body: text(text and code snippet), TTL, expiration date
- return type: status code
High-Level Design
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.
Detailed Component Design
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.