1. Create Short URL (Write Path)
POST /shorten
Request Body:
{
"long_url": "https://example.com/very/long/url",
"custom_alias": "optional_custom_code" // optional
}
Response:
{
"short_url": "https://short.ly/abc123"
}
Description:
2. GET /{shorten_URL}
Response:
{
"long_url": "https://example.com/very/long/url",
}
Description:
Overview:
Create short URLs from long URLs.
Redirect short URLs to the original URL.
URL SHORTENING for LONG URL:
Request Flow – Write Path (Short URL Creation)
Client sends POST /shorten request with a long URL.
Load Balancer distributes the request across stateless App Servers.
API Gateway handles routing, authentication, and rate limiting.
ID Generation Service generates a unique short code (Base62 encoding, or distributed ID like Snowflake).
Shortening Service:
Redirect SHORTENED URL:
Request Flow – Read PATH (Short URL READ)
Client sends GET /{}reqshort_URL}
Load Balancer distributes the request across stateless App Servers.
API Gateway handles routing, authentication, and rate limiting.
REDIRECT SERVICE looks for short_URL in Cache and if it is there it is returned, otherwise it is queried into database.