Case study

URL shortener

A URL shortening service built to practise caching, uniqueness, and rate limiting — not presented as a production SaaS.

Solo builder · 2024 · Web · Backend

A from-scratch shortener to work through collision handling, cache behaviour, and analytics on an otherwise simple product.

Uniqueness under write load, and avoiding a database hit on every redirect, are the interesting parts. The rest is scaffolding.

Solo: API, cache, tests, and a small frontend.

Collision-resistant short codes and a cache strategy that is not “add Redis later”.

Hash generation with uniqueness checks, Redis for hot redirects, per-user rate limiting, and redirect logs for a basic analytics layer.

Source on GitHub. Treated here as an engineering exercise, not a traffic claim.

Caching and uniqueness

Hot URLs in Redis; database on cache miss. Short codes checked for uniqueness without pretending this is a hyperscale system.

Node.js · TypeScript · PostgreSQL · Redis · Docker · Next.js · Jest

Useful for how the simple product hides architecture. Not a production traffic story.