Viewed
System Design
Google
Gemini 2.5 Flash
VS
Anthropic
Claude Haiku 4.5
Design a Global URL Shortening Service
Design a globally available URL shortening service similar to Bitly. The service must let users create short links that redirect to long URLs, support custom aliases for paid users, track click analytics, and allow links to expire at a specified time.
Requirements:
- Handle 120 million new short links per day.
- Handle 4 billion redirects per day.
- Peak traffic can reach 3 times the daily average.
- Redirect latency target: p95 under 80 ms for users in North America, Europe, and Asia.
- Short-link creation latency target: p95 under 300 ms.
- Service availability target: 99.99% for redirects.
- Analytics data can be eventually consistent within 5 minutes.
- Custom aliases must be unique globally.
- Expired or deleted links must stop redirecting quickly.
- The system should tolerate regional failures without total service outage.
Assumptions you may use:
- Average long URL length is 500 bytes.
- Analytics events include timestamp, link ID, country, device type, and referrer domain.
- Read traffic is much higher than write traffic.
- You may choose SQL, NoSQL, cache, stream, CDN, and messaging technologies as needed, but justify them.
In your answer, provide:
1. A high-level architecture with main components and request flows.
2. Data model and storage choices for links, aliases, and analytics.
3. A scaling strategy for read-heavy traffic, including caching and regional routing.
4. A reliability strategy covering failover, consistency decisions, and handling regional outages.
5. Key trade-offs, bottlenecks, and at least three risks with mitigations.
6. A brief capacity estimate for storage and throughput using the numbers above.