Loading...
- when user request short url he/she provides long url as param and get short url as response
- when user send request to short ulr he/she automatically redirected to long url
- url maximum length 2MB (2 million characters)
- availability - high 99.99% of all time
- scalability - high up to 5000K RPS
- security - medium basic authentication
- extensibility - low
Maximum 5K RPS, no load spikes
Maximum 1K short urls per user
Maximum 1M User Base
## Create a new short url
POST /shorts
Request Body:
json
{
"url": "value"
}
```
Response Body:
{
"uuid": "cf24b8dc-197c-4c81-a9dd-28c28580b7fd",
"url": "value",
"short": "value"
}
Get details on existing short url
GET /shorts/cf24b8dc-197c-4c81-a9dd-28c28580b7fd
{
"uuid": "cf24b8dc-197c-4c81-a9dd-28c28580b7fd",
"url": "value",
"short": "value"
}
## Data model
json
{
"uuid": "cf24b8dc-197c-4c81-a9dd-28c28580b7fd",
"url": "https://codemia.io/system-design/designing-a-simple-url-shortening-service-a-tinyURL-approach",
"short": "https://somedomainname.com/cf24b8dc-197c-4c81-a9dd-28c28580b7fd"
}
```
1 Postgres Write Database + 1 read replica
32 CPU cores
30 GB memory
SSD 10TB
- add multitenant user authorization
- add premium plan with maximum 1 million urls per user