notexOPENOverview
Notex/Systems/URL redirecting deep dive
08.12LESSON 12 OF 13 · 1 MIN READ

URL redirecting deep dive

Always free to read
SECTION VIDEOURL redirecting deep dive

Video coming soon. Start with the reading below.

COMING SOON

Figure 8-8 shows the detailed design of the URL redirecting. As there are more reads than writes, <shortURL, longURL> mapping is stored in a cache to improve performance.

Design a URL shortener — original diagram 109

The flow of URL redirecting is summarized as follows:

  1. A user clicks a short URL link: https://tinyurl.com/zn9edcu
  2. The load balancer forwards the request to web servers.
  3. If a shortURL is already in the cache, return the longURL directly.
  4. If a shortURL is not in the cache, fetch the longURL from the database. If it is not in the database, it is likely a user entered an invalid shortURL.
  5. The longURL is returned to the user.
Progress is saved on this device.
KEEP EXPLORING

One note leads to another.

Back to the library →
⌕
Search across the entire library ⌘ K