Design a URL shortening service like bit.ly or TinyURL. The system should generate a short, unique alias for a given long URL. When users access the short URL, they should be redirected to the original long URL. The system is read-heavy with approximately a 100:1 read-to-write ratio.
Functional requirements
- Generate a unique short URL for any given long URL
- Redirect users from short URL to the original long URL
- Allow optional custom short aliases
- Track basic click analytics
Non-functional requirements
- Low latency redirects (< 200ms)
- High availability (99.9% uptime)
- Short URLs should not be guessable