Design: URL Shortener
Design covers URL shortening, redirection, and basic analytics. User authentication, advanced analytics, and monetization are out of scope.
Functional Requirements
FR1: Generate a short alias for a given long URL
FR2: Redirect users from the short URL to the original long URL
FR3: Handle at least 100 million URLs
FR4: Support 10,000 requests per second for redirection
FR5: Ensure short URLs are unique and not easily guessable
FR6: Provide basic analytics: number of clicks per short URL
FR7: Allow users to customize the short URL alias (optional)
Non-Functional Requirements
NFR1: Latency for redirection should be under 100ms (p99)
NFR2: Availability target of 99.9% uptime
NFR3: Storage must be scalable to handle growth
NFR4: System should prevent collisions in short URL generation