Skip to content

Tech Choice Comparisons ​

1. Short Slug Generation: Nanoid vs MD5 Hash Truncation vs Base62 Auto-Increment vs UUIDv4 ​

CriteriaNanoid (Chosen)MD5 / SHA-256 TruncationBase62 Auto-IncrementUUIDv4
Slug Length7 characters7-8 charactersVariable (1 to 6 chars)36 characters (Too long)
Collision RiskNegligible ($64^7$ space)High after truncationZero (Monotonic ID)Zero
Information LeakageNone (cryptographically random)NoneHigh (Competitor counts)None
Coordination OverheadZero (Distributed)ZeroRequires centralized sequenceZero

Why Chosen: Nanoid provides collision resistance, zero coordination overhead, and complete privacy without exposing total business volume through sequential IDs.

2. Redirection Status: HTTP 302 Found vs HTTP 301 Moved Permanently ​

CriteriaHTTP 302 (Chosen)HTTP 301
Browser CachingNo caching (requests hit server every time)Cached aggressively by browser
Analytics Accuracy100% accurate per-click trackingDrops drastically after first visit
Server LoadHandles every click eventZero load on repeated clicks

Why Chosen: URL shorteners rely heavily on accurate telemetry and analytics for creators; HTTP 301 completely undermines this capability.