POST /v1/shortURL
body : {
longURL : string
}
resp : {
shortURL : string
}
GET /v1/longURL?shortURL=string
key value pair database will be a good choice here, because we will need to access longURL based on shortURL. It also ensure idempotency.
example
tinyurl.com/LX1GC : www.linkedin.com/profile/DariusChandra
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. If you are unfamiliar with the tool, you can simply describe your design to the chat bot and ask it to generate a starter diagram for you to modify...
KV database should be a NoSQL database that can be horizontally scaled. The API server can be an ECS instances that autoscale if there is huge traffic
We choose KV database NoSQL such as DynamoDB because of the access pattern where we map shortURL to longURL. It is managed by AWS for the scaling.