Junior — Senior
Creating a short URL service
livecode
Task condition
The system uses an LRU cache policy, TinyUrl services (POST/GET), and a horizontally scalable SQL database with replication. Model an external service responsible for generating short links:
- How to separate the process of obtaining the short_link from the logic of saving and retrieving data;
- How to guarantee the uniqueness of generated links, especially when generation occurs in multiple service instances;
- How to avoid race conditions during writing;
- How to synchronize identifiers or namespace if generation is distributed;
- How to establish interaction between TinyUrl POST and the link generator (gRPC, REST, etc.).