Questions:
We have read bias
Store Links indefinitely require an DB cluster
Post /v1/shorten
Body {"url": "
return 201 // no content
return 400 no valid url exists in the body
return 500 internal server error {"errorCode: int, message: ""}
GET
return 302 redirect
return 404 no short url found
return 500 internal server error {"errorCode: int, message: ""}
Notes on technology selection:
Database can have a basic table called urls, it has very basic information based on the requirements above. since we are user agnostic then the URL should be maybe have url, hash, created at and last accessed (this will help with crashes later to auto reload last access urls/hot urls) the last access at field will be pushed as a bulk snapshot from the KV store.
Database can be shared using hash ranges to have stable shards and avoid rebalancing.
FE:
URLProcessor: