Design Pastebin

Problem Statement:


Step-1: What is Pastebin?

Example:

Pastebin Site URL: https://pastebin.com

Access Pastebin Content: https://pastebin.com/Ha3CnnyK


Step-2: Requirements and Goals of the System


Step-3: Some Design Considerations


Step-4: Capacity Estimation and Constraints

Traffic estimates:
Storage estimates:
Bandwidth estimates:
Memory estimates:


Step-5: System APIs

Create API
addPaste(api_dev_key, paste_data, custom_url=None user_name=None, paste_name=None, expire_date=None)
Retrieve API
getPaste(api_dev_key, api_paste_key)
Delete API
deletePaste(api_dev_key, api_paste_key)


Step-6: Database Design


Step-7: High Level Design


Step-8: Component Design

a) Application Layer
How to handle a write request ?

Solution-1: Generate Hash for key and map to server

Solution-2: Key Generation Service (KGS)

How to handle a paste read request ?


b) Datastore Layer


Step-9: Data Partitioning and Replication


Step-10: Caching and Load Balancer (LB)


Step-11: Purging or DB Cleanup


Step-12: Telemetry


Step-13: Security and Permissions




← Previous: Design Tiny Url Service

Next: Design Instagram →