Loading...
POST /api/v1/shorten — Create a link. Accepts long_url, returns short_url.
GET /{short_url_id} — Redirect. Returns a 302 Found status and a Location header.
Describe the overall system architecture. Identify the main components needed to solve the problem end-to-end. Use the diagramming tool to create a block diagram.
Key Generation: We use Base62 encoding. For a 7-character ID, we get 62^7 (about 3.5 trillion) unique combinations. Caching: Using Redis to cache “hot” links. Since 20% of links typically generate 80% of traffic, the cache will significantly reduce the load on the database.