The request for the url should be seved within 100msec
The creation of the url can be slower if needed
there will be 100m requests a day to get a query
there will be 1m requests a day to create / update / delete the questy
The API will consiste of write logic and retrieve logic
Write logic:
GET /api/v1/url
RESPONSE: {
"urls": [{
id: hash
name: string,
url: string,
last_modified: datatime
},
...
],
error: string
}
GET /api/v1/url/:id
RESPONSE: {
name: string,
url: string,
last_modified: datatime
}
POST /api/v1/url
BODY: {
name: string,
url: string,
}
RESPONSE: OK, {
id: number
short_url: string
}
PUT /api/v1/url
{
name: string,
url: string
}
RESPONSE: OK, {
id: number
short_url: string
}
DELETE /api/v1/url/:id
Soft delete fo
GET /{HASH}
The users access the webpage via authenticated endpoint and use rest API to do a CRUD functionality
the CRUD will write to a store
When clients need to lookup the long URL using short url the server will search for the data using the hash and send redirect
Define the data model. Identify the main entities, their attributes, and relationships. Consider the choice of database type (SQL vs NoSQL) and justify your decision based on access patterns...
server in single datacenter