Building ezli.me, a link shortener in Rust

What it is
ezli.me is a compact Rust link-shortening service built because TinyURL tightened its free tier and the team didn't want to pay for another SaaS plan — or so it has been reported. The project answers a simple question: how much software do you actually need to redirect a URL? Short answer: not much. The public-facing bits are a static landing page, a tiny redirect handler, and an API protected by Cloudflare Turnstile for public creation and API keys for authenticated clients.
Under the hood
The stack is deliberately minimal: axum and tokio for the service, PostgreSQL with diesel for persistence, an in-memory quick_cache for hot links, and a background task that batches click counters into the database every few seconds. Short IDs are deterministic — the original URL is hashed then base62-encoded, and collisions are resolved by retrying with an offset. Clicks bump an in-memory counter; if one link is hammered a thousand times in three seconds, that still becomes a single row update on the next flush. GREATEST on last_used makes concurrent flushes across replicas safe. No Redis, no queue, no analytics pipeline, no admin backend. Clean and pragmatic.
Production and why it matters
It has been reported that ezli.me runs as two replicas in a K3s cluster with modest CPU/memory requests and limits, and migrations are baked into the binary. That’s the key emotional beat: once your platform is already running, small self-hosted services stop dragging a laundry list of new infrastructure. It’s the Unix philosophy for the cloud era — do one thing, and do it with what you already have.
Try it
The project is on GitHub under a dual MIT / Apache-2.0 license. Want a hosted API key? Join the project's Discord and ask. Simple, practical, and annoyingly effective. Who knew a link shortener could feel like a tiny victory for self-hosting?
Sources: rustunit.com, Lobsters
Comments