Database

Let us explore some of the choices for System Design of Databases of URL Shortner:

  • We can use RDBMS which uses ACID properties but you will be facing the scalability issue with relational databases.
  • Now if you think you can use sharding and resolve the scalability issue in RDBMS then that will increase the complexity of the system.
  • There are 30M active users so there will be conversions and a lot of Short URL resolution and redirections.
  • Read and write will be heavy for these 30M users so scaling the RDBMS using shard will increase the complexity of the design.

You may have to use consistent hashing to balance the traffics and DB queries in the case of RDBMS and which is a complicated process. So to handle this amount of huge traffic on our system relational databases are not fit and also it won’t be a good decision to scale the RDBMS. 

So let’s take a look at NoSQL Database:

  • The only problem with using the NoSQL database is its eventual consistency.
  • We write something and it takes some time to replicate to a different node but our system needs high availability and NoSQL fits this requirement.
  • NoSQL can easily handle the 30M of active users and it is easy to scale. We just need to keep adding the nodes when we want to expand the storage. 

System Design | URL Shortner (bit.ly, TinyURL, etc)

The need for efficient and concise URL management has become a big matter in this technical age. URL shortening services, such as bit.ly, and TinyURL, play a massive role in transforming lengthy web addresses into shorter, shareable links. As the demand for such services grows, it has become vital to undertand the System Design of URL Shortner and mastering the art of designing a scalable and reliable URL-shortening system, to gain a crucial skill for software engineers.

This article gets into the System Design of URL Shortner (URL Shortening Service), which will help in architecting a robust system that can seamlessly generate and redirect short URLs while ensuring scalability, durability, and high availability.

Important Topics for System Design of URL Shortner (URL Shortening Service)

  • How to Design a URL Shortener Service Like TinyURL?
  • Requirements for System Design of URL Shortner
  • Capacity estimation for System Design of URL Shortner
  • Low Level Design for System Design of URL Shortner
    • URL Shortening Logic (Encoding)
    • Techniques to Generate and Store TinyURL 
  • High-level Design for System Design of URL Shortner
  • Database
  • Conclusion

Similar Reads

How Would You Design a URL Shortener Service Like TinyURL?

URL shortening services like bit.ly or TinyURL are very popular to generate shorter aliases for long URLs. You need to design this kind of web service where if a user gives a long URL then the service returns a short URL and if the user gives a short URL then it returns the original long URL....

1. Requirements for System Design of URL Shortner Service

1.1 Functional requirements of URL Shortening service...

2. Capacity estimation for System Design of URL Shortner

Let’s assume our service has 30M new URL shortenings per month. Let’s assume we store every URL shortening request (and associated shortened link) for 5 years. For this period the service will generate about 1.8 B records....

3. Low Level Design for System Design of URL Shortner

...

3.1 URL Encoding Techniques to create Shortened URL

To convert a long URL into a unique short URL we can use some hashing techniques like Base62 or MD5. We will discuss both approaches....

3.2 Efficient Database Storage & Retrieval of TinyURL

...

4. High-level Design of a URL-Shortening Service

...

5. Database

Let’s discuss the mapping of a long URL into a short URL in our database:...

Conclusion

...

Contact Us