...

/

Requirements of TinyURL

Requirements of TinyURL

Understand the requirements and estimations for designing a URL shortening service.

Requirements

Following are the functional and non-functional requirements.

Functional requirements

  • Short URL generation: Our service should be able to generate a unique shorter alias of the given URL.
  • Redirection: Given a short link, our system should be able to redirect the user to the original URL.
  • Custom short links: Users should be able to generate custom short links for their URLs using our system.
  • Deletion: Users should be able to delete a short link generated by our system, given the rights.
  • Update: Users should be able to update the long URL associated with the short link, given the proper rights.
  • Expiry time: There must be a default expiration time for the short links, but users should be able to set the expiration time based on their requirements.

Quiz

1.

As a design choice, we don’t reuse the expired short URLs. Since we don’t reuse them, why do we need to delete them from our system?

Show Answer
Q1 / Q1
Did you find this helpful?

Non-functional requirements

  • Availability: Our system should be highly available; this is highly significant as even a fraction of the second downtime would result in URL redirection failures. Since our system’s domain is in URLs, we don’t have the leverage of downtime, and our design must have fault-tolerance conditions instilled in it.
  • Scalability: Our system should be horizontally scalable with increasing demand.
  • Readability: The short links generated by our system should be easily readable, distinguishable, and typeable.
  • Latency: The system should perform at low latency to provide the user with a smooth experience.
  • Unpredictability: From a security standpoint, the short links generated by our system should be highly unpredictable. It ensures the next-in-line short URL is not serially produced, eliminating the possibility of someone guessing all the short URLs that our system has ever produced or will produce.

Quiz

1.

Why is producing unpredictable short URLs mandatory for our system?

Show Answer
Q1 / Q1
Did you find this helpful?

Estimations

It’s better to have realistic estimations at the start; we might need to change them in the future based on the design modifications. Let’s make some assumptions to complete our estimation.

Assumptions:

  • We assume that the shortening:redirection request ratio is 1:1001:100.
  • There are 200 Million new URL shortening requests per month.
  • A URL shortening entry requires 500 Bytes of database storage.
  • Each entry will have a maximum of five years of expiry time unless explicitly deleted.
  • Number of Daily Active Users (DAU) are 100M

Storage estimates

Because entries are saved for a time period of 5 years and there are a total of 200 Million entries per month, the total entries will be approximately 12 Billion.

200 Million/month×12 months/year×5 years=12 Billion URL shortening requests200 \ Million/month \times 12 \ months/year \times 5 \ years = 12 \ Billion\ URL\ shortening\ requests ...

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy