Codele / System design
Design a link shortener, end to end
Turn a long web address into a short one, then grow the design stage by stage, using what the whole track taught you, until it can take huge traffic.
- A short code is a counter written in 36 symbols (0 to 9 and a to z). The server stores code to address in a table.
- Reads far outnumber writes: a link is made once and clicked thousands of times. So a cache of popular codes helps most.
- Grow the design only when the numbers demand it: cache, then more servers behind a load balancer, then database copies, then shards.
- Rate limiting in front protects every stage from one caller sending too much.
- Each stage solves one bottleneck and brings a cost, so do not add parts you do not need yet.
Loading the playable lesson…