← InfraDraft

Infrastructure Primitives

Design a URL Shortener (TinyURL)

A high-read-throughput redirect service mapping short codes to long URLs, with collision-free ID generation and edge-cached lookups.

Open and Simulate this Architecture in InfraDraft

Core Architectural Components

Short-Code Generator

Base62 counter or hash-plus-collision-check producing unique short codes.

Key-Value Mapping Store

Durable short-code-to-long-URL mapping, the system of record.

Redirect Service

Handles the 301/302 response on the hot read path.

Read-Through Edge Cache

CDN or in-memory cache absorbing the vast majority of redirect lookups.

Custom Alias & Expiry Management

Supports user-chosen slugs and time-limited links.

Click Analytics Event Pipeline

Streams redirect events for per-link click counting without slowing the redirect itself.

Abuse/Spam URL Filter

Blocklist and heuristic checks against malicious destination URLs.