Loading...
Assume:
👉 Total ≈ 20 TB → requires distributed storage
POST /shorten
Request:
{
"long_url": "https://example.com/abc",
"custom_alias": "optional",
"expiry": "optional"
}
Response:
{
"short_url": "https://sho.rt/xyz123"
}
GET /{short_code}
Response:
GET /analytics/{short_code}
Use:
Schema:
short_code (PK)
long_url
created_at
expiry
user_id
Use:
Key:
short_code → long_url
System divided into:
ID → Base62 encoding → short_code
Example:
123456 → "abcD"
👉 Benefits:
👉 Most requests never hit DB
hash(short_code)