Overview
Design a service that turns a long URL into a short one, redirects it back with a few milliseconds of overhead, supports custom aliases, and records click analytics.
Requirements
- 01Generate a unique short code (7 base62 characters) for any long URL
- 02Redirect a GET on the short URL to the original destination in under 10ms
- 03Handle ~100M new URLs a day on a 100:1 read-to-write ratio
- 04Record click analytics (visitor count, country, referrer) without slowing the redirect
- 05Stay available 99.99% of the time, with no duplicate keys
Concepts in play
HashingRedisNoSQLLoad BalancingAnalytics