High-Level Design
From Client
Client -> Load Balancer -> API Layer -> Cache Layer -> DB Layer
- Client
- Load Balancer
- Must redirect to the closest or most available cluster
- Cache: Caching Layer
- Redis takes advantage of geo-replications
- Write Policy: Write Through
- Read Policy: Hit then Cache
- UrlShortenerServer: API Layer
- Registers
- Check long url existence
- Create a shorten url to map with the long url
- Write to the database
- Write to cache
- Get and Redirect
- Check the cache then the database
- Update metadata
- Redirect
- Database: Storage Layer