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

Handling Never-Expiring Pastes

Design considerations for permanent pastes, balancing storage costs, and setting reasonable default expirations.

Handling Never-Expiring Pastes

You'll learn how to design for permanent pastes while balancing storage costs and system sustainability.

When users create pastes, some want them to last forever. While this sounds simple, it creates real challenges: unbounded storage growth, abandoned content consuming resources, and uncertainty about what to keep long-term.

The Permanent Paste Challenge

Truly "never-expiring" pastes accumulate indefinitely. If 10% of your pastes are set to never expire and you create 1 million pastes daily, you'll add 100,000 permanent entries every single day. Over a year, that's 36.5 million pastes that never get cleaned up—even if no one ever reads them again.

Design Considerations

Default Expiration Policy: Instead of allowing infinite TTL, set a "very long" default—perhaps 1 year, 5 years, or 10 years. This provides the illusion of permanence while ensuring eventual cleanup. Think of it like a library lease: users can always renew, but nothing is truly permanent by default.

Explicit Renewal Mechanism: Require users to actively renew pastes beyond a certain period (e.g., after 5 years). This confirms the content still has value. Inactive accounts with "permanent" pastes get cleaned up if not renewed.

Storage Cost Tiers: Offer permanent storage as a premium feature. Free users get maximum 1-year retention; paid users can request truly permanent pastes. This aligns costs with value.

Access-Based Extension: Implement a "last accessed" timestamp. Pastes viewed recently get their expiration extended automatically, while truly abandoned content eventually expires.

Balancing Act

The goal is sustainability: your system shouldn't collapse under abandoned "permanent" pastes while still serving users who genuinely need long-term storage.

Key Takeaway: Never-expiring pastes should be treated skeptically—use reasonable default expirations (1-10 years), require renewal mechanisms, or tier permanent storage as a premium feature to prevent unbounded growth of abandoned content.