![]() Shortened URLs generated in 100 years : 120 billionįollowing is high level design of our URL service. To cache 20% of these requests, we will need ~70GB of memory.Ġ.2 * 700 million * 500 bytes = ~70GB Estimates Since we get 8000 read/redirection requests per second, we will be getting 700 million requests per day: With 200:1 read/write ratio, number of redirections = 40 URLs/s * 200 = 8000 URLs/s StorageĪssuming lifetime of service to be 100 years and with 100 million shortened links creation per month, total number of data points/objects in system will be = 100 million/month * 100 (years) * 12 (months) = 120 billionĪssuming size of each data object ( Short url, long url, created date etc.) to be 500 bytes long, then total require storage = 120 billion * 500 bytes = 60TB Memoryįollowing Pareto Principle, better known as the 80:20 rule for caching. Number of unique shortened links generated per seconds = 100 million /(30 days * 24 hours * 3600 seconds ) ~ 40 URLs/second Number of unique shortened links generated per month = 100 million Service should expose REST API’s so that it can be integrated with third party applications.URL redirection should be fast and should not degrade at any point of time (Even during peak loads).Service should be up and running all the time.Once a shortened link is generated it should stay in system for lifetime.Service should collect metrics like most clicked links.Users can create custom url with maximum character limit of 16. ![]() Shortened link should be as small as possible.Click to the short URL should redirect the user to the original long URL.Service should be able to create shortened url/links against a long url.Service should also aggregate metrics like number of URL redirections per day and other analytics for targeted advertisements. How many url shortening request expected per month ?Īssume 100 million new URL shortenings per monthĭo we expect service to provide metrics like most visited links ? Yes user can create a tiny url of his/her choice. How long a tiny url would be ? Will it ever expire ?Īssume once a url created it will remain forever in system.Ĭan a customer create a tiny url of his/her choice or will it always be service generated ? If user is allowed to create customer shortened links, what would be the maximum size of custom url ? This will then become the basis for functional requirements. Hence it’s always a good idea to ask interviewer what features are expected in the service. There can be myriad of features even in seemingly small service like URL shortening. I have created a tiny url to my medium profile using a free short link generation service called (Try clicking shortened link and also try generating few short urls on your own at ) ![]() In addition, it is easy and less error prone to type a short url when compared to its longer version.įor e.g. T iny url are exceedingly handy to share through sms/tweets (where there is limit to number of characters that can be messaged/tweeted) and also when they are printed in books/magazines etc.(Less character implies less printing cost). A URL shortener service creates a short url/aliases/tiny url against a long url.Moreover, when user click on the tiny url, he gets redirected to original url.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |