![]() We can compute a unique hash (e.g., MD5 or SHA256, etc.) of the given URL. The approach we will be looking at today is by encoding the actual URL. The biggest question for our service is how to generate a short and unique key when given an URL. The best choice would be to use a NoSQL database store like DynamoDB or Cassandra since we are storing billions of rows with no relationships between the objects. We need one table for storing information about the URL mappings and another database for the user's data who created the short links. There are no relationships between each record, except for storing which user created the short link. The service needs to store billions of records. Let's look at some observations about the data we are storing: A successful deletion will return URL Removed. The url_key is a string that delineates the shortened URL that needs to be deleted. Traffic estimates: Assuming, we will have 500M new URL shortenings per month, with 100:1 read/write ratio, we can expect 50B redirections during the same period:Įnter fullscreen mode Exit fullscreen mode Let’s assume a 100:1 ratio between read and write. There will be a large number of redirection requests compared to new URL shortenings. Short links will expire after a default timespan, but users are able to specify the expiration time. Users should have the option to pick a custom short link for their URL. The short link should redirect users to the original link. This new link will be extensively shortened so that it can be easily copied and pasted. When given a URL, our service will generate a shorter alias of the original URL. Shortened links should not be predictable in any manner. URL redirection should happen in real-time with minimal latency. If the service fails, all the short links will not be functional. ![]() When designing a TinyURL-like application, there are some functional and non-functional requirements to consider. This service is useful because short links save space and allow users to type long URLs more easily. When clicking the short link, users are redirected to the original URL. TinyURL is a URL shortening web service that creates shorter aliases for long URLs. Today, we will go over system design principles by designing Instagram and TinyURL. Now, system design is often a requirement to land your dream software engineering job. With applications becoming increasingly large, it's important to design architectural patterns that are both efficient and reliable. In today's tech industry, understanding system design is more important than ever. This post was written by Aaron Xie and was originally published at Educative.io ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |