List functional requirements for the system
List non-functional requirements for the system...
for 1 day
Data per url = 100 bytes
total Data for 10,000 URL per second = 10000 * 100 = 1000000 bytes = 1 MB/ second.
for over 5 years:
1 MB/ second * 1500 = 1500MB /second.
database
Assuming insert operation take 1 ms.
insert operations = 10000 inserts/second
request per second = 10000 requests
request : {
longUrl : "String"
}
response : {
shortUrl: "String"
longUrl : "String"
}
GET /{alias}
simple get request
response : (HTTP 301 or 302) to original URL
GET /url/{alias}
response{
shortUrl: "String"
longUrl : "String"
clicks : 100,
createdAt: dateTimeStamp
}
DELETE /url/{alias}
Response: {
"message": "URL Deleted"
}
User table:
user_id
username
password
create_at
shortend_Url table:
url_id
long_url
short_code
user_id
created_at
expires_at
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...
Explain how the request flows from end to end in your high level design. Also you could draw a sequence diagram using the diagramming tool to enhance your explanation...
Dig deeper into 2-3 components and explain in detail how they work. For example, how well does each component scale? Any relevant algorithm or data structure you like to use for a component? Also you could draw a diagram using the diagramming tool to enhance your design...
Explain any trade offs you have made and why you made certain tech choices...
Try to discuss as many failure scenarios/bottlenecks as possible.
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?