Category
database
2 articles in this category
LLD for URL Shortener: Designing TinyURL
TLDR: A URL Shortener maps long URLs to short IDs. The core challenge is generating a globally unique, short, collision-free ID at scale. We use Base62 encoding on auto-incrementing database IDs for deterministic, collision-free short codes. š The...
ā¢5 min read

Types of Locks Explained: Optimistic vs. Pessimistic Locking
TLDR: Pessimistic locking locks the record before editing ā safe but slower under low contention. Optimistic locking checks for changes before saving using a version number ā fast but can fail and require retry under high contention. Choosing correct...
ā¢6 min read
