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
The system consists of Entry Layer, Data Plane (read path), and Control Plane (write path).
Structure:
[ timestamp | machine_id | sequence ]
Example:
π Ensures:
Convert ID β Base62:
ID β Base62 β short_code
π Most requests never hit DB
hash(short_code)
Only 1 request hits DB
Others wait or reuse result
Track:
If threshold exceeded:
π Ensures:
Mitigation:
If cache miss:
Track:
Tools:
π Ensures:
π Prevents: