System Design Problems
1 min read

URL Shortener Design: IDs, Storage, and Scale

A comprehensive guide to designing a scalable URL shortening service like bit.ly or TinyURL.

  • Generate short URLs from long URLs
  • Redirect short URLs to original URLs
  • Optional: Custom short URLs
  • Optional: Analytics and tracking
  • High availability
  • Low latency redirects
  • Scalable to billions of URLs

The system consists of:

  1. API Gateway: Handles incoming requests
  2. URL Service: Generates and manages short URLs
  3. Database: Stores URL mappings
  4. Cache: For frequently accessed URLs
  • Base62 encoding (a-z, A-Z, 0-9)
  • 7 characters = 62^7 = ~3.5 trillion unique URLs
  • NoSQL (e.g., DynamoDB, Cassandra) for high write throughput
  • Key-value store optimized for lookups

More detailed implementation notes coming soon…

Read more

  • Previous

    Design Amazon Shopping Cart

    System Design / System Design Problems 22 min read

    A system design for an e-commerce shopping cart handling millions of concurrent users, real-time inventory, dynamic pricing, and distributed checkout. This design focuses on high availability during flash sales, consistent inventory management, and seamless guest-to-user cart transitions.

  • Next

    Design a Cookie Consent Service

    System Design / System Design Problems 25 min read

    Building a multi-tenant consent management platform that handles regulatory compliance (GDPR, CCPA, LGPD) at scale. Cookie consent services face unique challenges: read-heavy traffic patterns (every page load queries consent status), strict latency requirements (consent checks block page rendering), regulatory complexity across jurisdictions, and the need to merge anonymous visitor consent with authenticated user profiles. This design covers edge-cached consent delivery, anonymous-to-authenticated identity migration, and a multi-tenant architecture serving thousands of websites.