Loading...
The client would either post a shorten or regular url path.
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
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