Designing a URL-shortening service — Part I
5 min readSep 15, 2024
Contents
- What is URL shortening and why do we need URL shortening?
- Requirements of the System — Functional and Non-Functional.
- Capacity Estimation.
- Basic System API.
- Basic Database Design.
- Basic System Design — Possible Solution 1: Encode the URL
What is URL shortening and why do we need URL shortening
URL shortening service provides short aliases that redirect us to the original long URL. This saves a lot of space when it is displayed, or if we share it. These can be extended to analyze usage, performance, etc.
Tiny URL is one such service for shortening the URL. The URL is generated if we provide any URL and click the Shorten URL button.
Requirements of the System
Functional Requirements
- If we give a URL to our service, it must generate a shorter and unique alias.
- The shortened URL should redirect the user to the actual URL.
- The links must expire after a certain time and the user can provide this interval.