![]() ![]() for 7 characters short URL, we can serve 62^7 ~= 3500 billion URLs.allows us to use the combination of characters and numbers which contains A-Z, a-z, 0–9 total( 26 + 26 + 10 = 62).Use some hashing techniques like Base62 or MD5.Think about the reads and writes that will happen - to decide what kind of database (RDBMS or NoSQL) to use. Total of 2.031KB per shortened URL entry in the database. Short URL size: 17 Bytes for 17 character Think about the different columns or attributes that will be stored in our database and calculate the storage of data for five yearsĬonsider average long URL size of 2KB ie for 2048 characters. Understand how much data we might have to insert in our system. These characters are a combination of 62 characters something like.We are using 7 characters to generate a short URL.Total records: about 1.8 B records = 30 million * 5 years * 12 months = 1.8B.we store every URL shortening request (and associated shortened link) for 5 years.> 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) Non-Functional Requirements: -> 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 > Do we expect service to provide metrics like most visited links ?įunctional Requirements: -> Service should be able to create shortened url/links against a long url > How many url shortening request expected per month ? > If user is allowed to create customer shortened links, what would be the maximum size of custom url ? > Can a customer create a tiny url of his/her choice or will it always be service generated ? > Shortened links should not be predictable. > URL redirection should happen in real-time with minimal latency. This is really important to consider because if the service goes down, all the URL redirection will start failing. > The system should be highly available. > Links will expire after a standard default time span. > When the user hits a short link, the service should redirect to the original link. Requirements: -> Given a long URL, the service should generate a shorter and unique alias of it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |