top of page

Designing a URL Shortener Application or a Tiny Url/Bitly | System Design

Updated: Dec 8, 2022

Some common examples of URL Shortener applications are,

Having a good and efficient system is very important when it comes to creating a new system. A good system design makes sure that the system is resilient, highly available, easily scalable, and fault tolerant. In this blog, I will be designing a URL shortener application (also known as Tiny URL) that would be strong enough to work at scale.

Let's dive right in -

The Problem Statement

Design a highly scalable system to shorten URLs, i.e when the user inputs a long URL, the system needs to return a short URL. When any person hits the short URL, it needs to return the longer URL, and redirect the browser to this URL.

What is a Tiny-URL or URL shortener?

A tiny URL or URL shortener is a service that creates a shorter version of long URLs.

It's a system similar to solutions that companies like `bitly` provide. People generally prefer the shortened version of the URL as it is easier to manage and share.

For example, if the input to the system is

our system should provide output something like:


You may think that the solution to the above problem looks simple! Right?

Generate a random number and store it in a map with the longer URL!

The problem with the above solution is that it is not scalable. By the end of this blog, we will be coming up with a solution that would work great at scale.

Modularising the problem statement:

Before jumping right in, I will divide the problem statement into the following sub-problem statements :

- Designing the final output string

- Methods to generate the output string discussed in the above point

- The above output string should not be predictable

Apart from the above, we should also make sure that the short link will redirect users to the original long URL with minimal latency. Our system should also be highly available across the globe. A nice-to-have feature would be if the users can provide short custom short URLs and an expiration time for each of these short URLs.

Let's start by designing the final output string

Designing the final output string (characters and its length)

We know the output string should look like


The variable in the above part is `random-string`. I am assuming that my `random-string` will contain the following characters :

​( A - Z )