Case study
URL shortener
A URL shortening service built to practise caching, uniqueness, and rate limiting — not presented as a production SaaS.
Context
A from-scratch shortener to work through collision handling, cache behaviour, and analytics on an otherwise simple product.
Problem
Uniqueness under write load, and avoiding a database hit on every redirect, are the interesting parts. The rest is scaffolding.
My role
Solo: API, cache, tests, and a small frontend.
Challenge
Collision-resistant short codes and a cache strategy that is not “add Redis later”.
Approach
Hash generation with uniqueness checks, Redis for hot redirects, per-user rate limiting, and redirect logs for a basic analytics layer.
Outcome
Source on GitHub. Treated here as an engineering exercise, not a traffic claim.
What shipped
Caching and uniqueness
Hot URLs in Redis; database on cache miss. Short codes checked for uniqueness without pretending this is a hyperscale system.
Stack
Node.js · TypeScript · PostgreSQL · Redis · Docker · Next.js · Jest
Useful for how the simple product hides architecture. Not a production traffic story.