A key generation service hands out unique 7-character Base62 keys from pre-allocated ranges, so creating a link never needs a uniqueness check. Redirects are a single key lookup served mostly from cache (and even from the CDN edge), and click events flow asynchronously to analytics so the redirect path stays tiny.
Functional requirements
- Given a long URL, return a short unique link
- Visiting the short link redirects to the original URL
- Optional custom alias and expiry time
- Per-link click statistics
Non-functional requirements
- Redirects in a few milliseconds, very high availability
- Read-heavy: about 100 redirects per link created
- Keys must be unique and hard to guess in sequence
- Links are never lost before they expire
Extensions
- Custom domains for branded links.
- QR codes for each link.
- Link previews and safety warnings.
- Per-user dashboards with click charts.