SysPad › Examples › URL shortener
URL shortener
A compact read-heavy service: CDN, API, a hot-links cache, a key-value store, and a click-analytics stream.
A simple read-heavy path - a gentle first example.
- Throughput: 8,000 req/sec
- First to saturate: Shortener API
- Estimated cost: $22k/mo
How it works
- CDN
- Even a redirect is cacheable. Seven in ten requests are answered at the edge and never reach the API at all.
- Hot Links
- A small number of links take most of the traffic, so a 95% hit rate is realistic here. Every hit is a lookup the links table never sees.
- Links Table
- Reads outnumber writes roughly ten to one: creating a link is rare, following one is constant. That ratio is what makes the whole design cheap.
- Click Stream
- Click analytics is fire-and-forget. The redirect is already travelling back to the browser while this write is still in flight.