Requirements


Functional Requirements:


  • Create a short URL for a given long URL.
  • Return the long URL associated with a given short URL.



Non-Functional Requirements:


    List the key non-functional requirements (eg low latency, scalability, reliability, etc.)...


API Design

The client would either post a shorten or regular url path.


High-Level Design

The client hits the server with either a shortened URL or a URL to shorten. Either way it checks if the shortened URL exisits in the key-value cache. If there is a miss it goes to the Database where it can update the cache



Detailed Component Design

The database is ACID compliant. This means it can be SQL where it stores the url -> shorten url.

The cache would be like REDIS as a key-value store where lookups are faster than a database query

The server would either translate a url to a shorten url by generating a unique key or using a shorten url to get the real url and transfer the user to the correct page