Middle — Senior
Designing the complete process of creating a short link (POST flow)
livecode
Task condition
The complete architecture of the service includes:
- API gateway with load balancing and access rights verification
- TinyUrl service responsible for POST requests
- External short URL generator (Tiny URL creator)
- Distributed real lock
- Cache layer (LRU)
- Horizontally scalable SQL database with replication
It is necessary to describe and design the entire process of creating a short link:
- How the request from the client passes through the API gateway
- How the short_link is formed considering locking (taking into account 200 million links + real lock)
- How the record gets into the appropriate SQL shard
- Whether the cache needs to be updated and how it is done
- What bottlenecks may arise and what scaling strategies are applicable