1 Return hashUrl of the url enetered by the user
2 The url can be used to redirect user same as original url
System should have low latency and high reliablity
Total number of activite users 10000000
Number of urls share 10
total number of transactions in a day are 10,000,000*10= 10^8
Lets round the vlaue of 86400 to 10^5
so total number of qas =10^8/10^5 =10^3
/v1/create-shortUrl the following api will return the hash of the api
As the system is ready heavy so we will be using the relation database and it will have only one table nameed shortUrl and will have two columns url and hash of the url
user makes a call to load balancer then load balancer forwards the clal to api servers from api server first we check if the record is present in the cache if it is present then provide entry from the cache else the call is made to hash function to get the hashed value of the url the hashed value is then stored into the db and then finally returned to user
user makes a call to load balancer then load balancer forwards the clal to api servers from api server first we check if the record is present in the cache if it is present then provide entry from the cache else the call is made to hash function to get the hashed value of the url the hashed value is then stored into the db and then finally returned to user
Dig deeper into 2-3 components and explain in detail how they work. For example, how well does each component scale? Any relevant algorithm or data structure you like to use for a component? Also you could draw a diagram using the diagramming tool to enhance your design...
Explain any trade offs you have made and why you made certain tech choices...
Try to discuss as many failure scenarios/bottlenecks as possible.
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?