advancedTop 15 System Design Questions
Design a URL shortener (bit.ly) that handles 100K redirects/second.
ID generation: Redis INCR + base62 encoding (or distributed ID like Snowflake) Write path: store {shortCode → longUrl} in MongoDB + Redis cache Read path: GET url:{code} from Redis (< 1ms); miss → MongoDB → cache Redis cluster: 3 masters × 100K ops/s each = 300K ops/s capacity MongoDB: partitioned by shortCode for durability Analytics: INCR clicks:{code} in Redis; batch flush to MongoDB hourly Cus
This is a Pro chapter
Sign in, then upgrade to Pro or Power to unlock this and the full Databases Mastery library.
Design a URL shortener (bit.ly) that handles 100K redirects/second.