Course contentsShow
← System Design
Lesson 1543 of 1,91938. Real-World System: PastebinFree lesson

Functional Requirements for Pastebin

Defining key features: paste creation, unique URL generation, paste retrieval, and optional expiration.

Functional Requirements for Pastebin

What you'll learn: You'll identify the core features that define Pastebin's behavior from a user's perspective.

What Are Functional Requirements?

Functional requirements describe what a system must do—the specific features and behaviors users expect. For Pastebin, a service that lets users share text snippets, we need to nail down the essential actions users can perform before diving into architecture.

Core Features of Pastebin

1. Paste Creation

Users must be able to submit text content. This involves accepting input (code snippets, logs, notes), storing it securely, and confirming successful creation. Think of this as the "write" operation—the system's primary input.

2. Unique URL Generation

Every paste needs a distinct, shareable identifier. When a user creates a paste, the system generates a short, unique URL (like pastebin.com/a3fG7k) that points to that specific content. This is similar to the URL shortener we studied, but tailored for text content rather than redirects.

3. Paste Retrieval

Users must retrieve pastes via their unique URLs. This is the "read" operation—fetching and displaying the stored text when someone visits the link. This will be the most frequent operation, making Pastebin heavily read-oriented.

4. Optional Expiration

Pastes should support time-based expiration (e.g., delete after 1 hour, 1 day, or never). This helps manage storage costs and user privacy. Some pastes are temporary (sharing logs for debugging), while others might be permanent (documentation snippets).

Why These Requirements Matter

These four features form Pastebin's minimal viable functionality. Without them, it's not Pastebin. They also hint at design decisions: URL generation needs to avoid collisions, retrieval needs caching for performance, and expiration requires background cleanup jobs.

Key Takeaway: Pastebin's functional requirements center on four capabilities: creating text pastes, generating unique shareable URLs, retrieving content efficiently, and optionally expiring pastes after a set time.