Engineering
How we scaled ZipZy short links to 50M redirects a month
A look at the caching, database, and edge-routing decisions behind ZipZy's redirect layer — and the mistakes we made along the way.
Updated January 22, 2026

Every short link is a promise: tap it, and you land where you expect, instantly. Keeping that promise at scale is harder than it looks. Here's how the ZipZy redirect layer evolved.
The naive first version
Our first redirect handler did exactly one thing: look up a slug in MySQL, then issue a 302.
It worked beautifully — until it didn't.
The database is not a cache. Treating it like one is the fastest way to page yourself at 3am.
Adding an edge cache
We moved hot slugs into an in-memory layer and let the edge do the heavy lifting.
Tip
Cache the resolution, not the request. A slug maps to a destination; that mapping rarely changes, so it caches almost perfectly.
Here's the simplified lookup:
async function resolve(slug: string): Promise<string | null> {
const cached = await edge.get(slug);
if (cached) return cached;
const row = await db.query("SELECT dest FROM links WHERE slug = ? LIMIT 1", [slug]);
if (!row) return null;
await edge.set(slug, row.dest, { ttl: 3600 });
return row.dest;
}What we measured
| Layer | p50 | p99 | Hit rate |
|---|---|---|---|
| MySQL only | 42 ms | 180 ms | — |
| + memory cache | 3 ms | 22 ms | 94% |
| + edge cache | 0.8 ms | 6 ms | 99.2% |
The checklist we now follow
- Cache resolutions at the edge
- Set a sane TTL and invalidate on edit
- Keep the DB path fast for the 1% miss
- Move analytics writes fully async (in progress)
Small, boring decisions compound. That's the whole trick.1
Footnotes
-
We revisit these numbers quarterly. Your traffic shape will differ. ↩

Written by
ZipZy Team
Aarav leads infrastructure at ZipZy and has a soft spot for boring, reliable systems.
Related articles

Building a URL Shortener: A System Design Guide
A practical system design walkthrough of a URL shortener—key generation, storage, redirects, caching, and scale—for engineers who want to understand how it works.

A Beginner's Guide to Campaign Tracking
Learn campaign tracking end to end—UTMs, trackable links, analytics, and attribution—so you can finally see which marketing efforts actually drive results.

Why Use a Custom Domain for Short Links? A Complete Guide
Discover why branded custom domains beat generic short links—more trust, higher click-through, better brand recall—and how to set one up with DNS in minutes.