It takes a long URL to a shorter, unique alias that redirects (the redirections may includes analytics) to the original URL. This alias is often a fixed-length string of characters.
Requirements
- 100M Daily Active Users
- Read:write ratio = 100: 1
- 100 million read requests per day
- 1 million write requests per day
- Data retention for 5 years
- Assuming each entry is about 500 bytes
Endpoints
Create short URL
User request a short URL
- Generate short, fixed sized, unique URL
- Save the short and long URL mapping
- Return the short URL
Redirect short URL
User Get short URL
- Find the original URL from cache or database
- Log the analysis
- Return HTTP 302 redirect to original URL
Get analysis
- Look up aggregated analytics data from cache or database
- Return click count, time-based stats, or geographical breakdown