SysPad › Examples › URL shortener
URL shortener
Cache-aside redirect reads (app servers → Redis → DB on miss), a dedicated base62 ID-generator on the write path, and an async click stream feeding an analytics lake.
The read/write split - a heavily-skewed redirect read path kept off the database by cache, ID minting as its own service, and click analytics decoupled onto a stream.
- Throughput: 20,000 req/sec
- First to saturate: Click Stream
- Estimated cost: $55k/mo
How it works
- Redirect Cache
- Redirect traffic is enormously skewed toward a few hot links, so most lookups end here and never reach the database. This is what makes reads cheap.
- ID Generator (base62)
- Mints a unique base62 short code on write so concurrent shorten requests never collide: a dedicated key-minting step rather than a random-and-retry in the app.
Request flows
Follow short link
- Client
- DNS
- Load Balancer
- App Servers
- Redirect Cache
- URL Database
Shorten a URL
- Client
- DNS
- Load Balancer
- App Servers
- ID Generator (base62)
- URL Database
- Redirect Cache
Click analytics
- Client
- DNS
- Load Balancer
- App Servers
- Click Stream
- Click Aggregator
- Analytics Lake