Sobes.tech
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:

  1. How the request from the client passes through the API gateway
  2. How the short_link is formed considering locking (taking into account 200 million links + real lock)
  3. How the record gets into the appropriate SQL shard
  4. Whether the cache needs to be updated and how it is done
  5. What bottlenecks may arise and what scaling strategies are applicable