PasteIt is building a text-sharing service where developers paste code snippets and share them via a link. Features:
- Create pastes - submit text content with an optional title, syntax language (for highlighting), and expiration time (10 minutes, 1 hour, 1 day, 1 week, never).•View pastes - anyone with the link can view the paste with syntax highlighting. No authentication required.•Private pastes - optionally password-protect a paste or mark it as "unlisted" (not indexed but accessible via direct link).•Raw view - a /raw endpoint that returns the plain text content (for `curl` / scripts).•Automatic cleanup - expired pastes are deleted by a background job.
Expected traffic: 50,000 new pastes per day, 500,000 paste views per day.
Design a Pastebin-like service for sharing text snippets with syntax highlighting and expiration. Build this architecture under realistic production constraints, then validate tradeoffs in the design lab simulation.
Request path: The solution keeps ingress, service logic, and stateful dependencies separated so each layer can scale independently.
Reference flow: Web Clients -> API Gateway -> API Service -> Primary SQL DB -> Object Storage