out of scope:
List non-functional requirements for the system...
dau
storage
create redirect:
POST /api/v1/redirect/create
body: {
long_url: string,
short_path?: string,
}
response: {
short_path: string,
}
error: 409, short_path already exists
GET /:short_path
=> 302 temporary redirect to long url
error => 404 not found
note: 302 instead of 301 for better analytics. trade-off higher load
short_url
You should identify enough components that are needed to solve the actual problem from end to end. Also remember to draw a block diagram using the diagramming tool to augment your design...
create redirect:
consume redirect
unique short_url generation:
scale write speeds:
scale read speeds:
click aggregator:
DB
hash
Availability >> Consistency for reads
Consistency >> Availability for writes