POST /api/v1/{longUrl}
Response with 201
{
"shortUrl": "tinyUrl/abc123",
"createdAt": "timestamp"
"expiresAt": "timestamp"
}
with Authentication - API key and rate limiting.
Every API Key gets 100 urls for a free tier.
Redirect:
GET /shortUrl
Return and redirect to original URL with 302 found response when found without authentication, otherwise return 404.
Rate limiting is key for protection against abuse.
Describe the overall system architecture. Identify the main components needed to solve the problem end-to-end. Use the diagramming tool to create a block diagram.
client interacts API Gateway using CDN for calling shortening service and stores in dynamo db.
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.
Identify the collision risk and tradeoff