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
URL shortening Hash + collision resolution
Base 62 conversion
- Assuming the input longURL is: en.wikipedia.org/wiki/Systems_design
- • 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