NewsBuzz22

URL Shortening: Unveiling the Magic and Mayhem of URL Shortening

BY : SURANI SMIT

We’ve all been there. You find an amazing article, a hilarious cat video, or that perfect recipe you just have to share with the world. But then you slam face-first into a URL that looks like a runaway keyboard incident. Stringing together enough nonsensical letters and numbers to choke a modem, these monsters make sharing a nightmare.

Instead of princesses needing rescue, the online world has a different kind of hero. It’s not a knight in armor, but a URL shortener. Think of it as a helpful tool that works behind the scenes (sometimes with a cool website design, depending on the service). This tool fights the bad guys: those super long URLs that are annoying to share. With a simple click, the URL shortener shrinks these monsters down to bite-sized links, making them easy to share with friends. But there’s more to this story than meets the eye. Behind the scenes, there’s a whole world of technology and marketing tricks (and maybe a few technical glitches) that make URL shortening work!

How Does URL Shortening Work?

There are two main techniques behind URL shortening:

  1. Hashing: This method involves converting the long URL into a unique alphanumeric code using a hashing algorithm. The resulting code serves as the shortened URL. It’s important to note that hashing can sometimes lead to collisions, where two different long URLs might get shortened to the same code. To address this, most services employ additional measures to ensure uniqueness.
  2. Database Storage: Here, the long URL is stored in a database along with a unique identifier. This identifier then becomes the shortened URL. This approach allows for more control and avoids potential collision issues.

URL Shortening System Design – System Design

URL Shortening System Design – System Design

Terminology

The following terminology might be useful for you:

URL Shortening and Digital Marketing

URL shortening plays a vital role in digital marketing strategies:

What is a URL shortening service?

URL shortening service is a website that substantially shortens a Uniform Resource Locator (URL). The short URL redirects the client to the URL of the original website. Some popular public-facing URL shortening services are tinyurl.com and bitly.com1.

The reasons to shorten a URL are the following:

Choosing a URL Shortening Service

Several URL shortening services are available, each with its own features and functionalities. Here are some factors to consider when choosing one:

Questions to ask the Interviewer

Candidate

  1. What are the use cases of the system?
  2. What is the amount of Daily Active Users (DAU) for writes?
  3. How many years should we persist the short URL by default?
  4. What is the anticipated read: write ratio of the system?
  5. What is the usage pattern of the shortened URL?
  6. Who will use the URL shortener service?
  7. What is the reasonable length of a short URL?

Interviewer

  1. URL shortening and redirection to the original long URL
  2. 100 million DAU
  3. 5 years
  4. 100: 1
  5. Most of the shortened URLs will be accessed only once after the creation
  6. General public
  7. At most 9 characters

Requirements

Functional Requirements


Non-Functional Requirements


Out of Scope

URL Shortener API

This is the improved Version of the Initial URL Shortening Service we built in class. This can be directly deployed using Vercel

“For those interested in learning more about URL Shorting, I highly recommend checking out my teacher’s GitHub profile: SAMARANJIT-GHOSE. They have a wealth of experience and resources available, including URL-Shorting.”

LINK: https://github.com/smaranjitghose/coolurl

Table of Contents

Instagram Page

Latest Post

Exit mobile version