Loading...
shortenUrl()
redirectUrl()
The design is client will request to server for shortening the url, and for shorten url, it will save the url to database as key value format
When getting redirect url, for the first time request it will check the db and return 302 response, then put the visited data to redis cache, after that similar request will be provided by redis cache
Shortener service will receive long url, and will generate short random string as shortened url, it will return to user as something like https://bit.ly/asHao9
After returning the short url, shortener service will input that to redis for faster access
Table: url
Column:
URL: Varchar(200)
ShortenedUrl: Varchar(20)