System Design 
DESIGN A URL SHORTENER

System Design DESIGN A URL SHORTENER

Use cases:

  • Write operation: 100 million URLs are generated per day.

  • URL shortening: given a long URL => return a much shorter URL

  • URL redirecting: given a shorter URL => redirect to the original URL

  • High availability, scalability, and fault tolerance considerations

Screen Shot 2022-09-07 at 11.04.04 PM.png

URL shortening Screen Shot 2022-09-07 at 11.05.07 PM.png Hash + collision resolution Screen Shot 2022-09-07 at 11.07.32 PM.png

Base 62 conversion

Screen Shot 2022-09-07 at 11.18.51 PM.png

Screen Shot 2022-09-07 at 11.14.22 PM.png

  • • Unique ID generator returns ID: 2009215674938.
  • • Convert the ID to shortURL using the base 62 conversion. ID (2009215674938) is converted to “zn9edcu”.
  • • Save ID, shortURL, and longURL to the database as shown in Table 8-4.

URL redirecting deep dive Screen Shot 2022-09-07 at 11.16.13 PM.png