The SYSTEM should return the TinyURL when a long URL is provided and mapped to a TinyURL.
The SYSTEM should create and return a TinyURL when a long URL is provided, and the long URL is not mapped to a Tiny URL
The SYSTEM should maintain the Tiny URL mapped to the long URL for 5 years.
The SYSTEM should return the long URL mapped tot he TinyURL when the TinyURL exists.
A TinyURL will be defined by 14 bytes, 1 byte of server ID, 4 bytes to represent the date, 3 bytes to represent the time and the last 6 bytes to represent the fractional seconds.
GET: Get_TinyURL
{
"TinyURL" : <Tiny URL>,
"Long URL" : <long URL>
}
DELETE: Delete_URL
{
"TinyURL" : <Tiny URL>,
"Long URL" : <long URL>
}
Columnar Database: Cassandra. Cassandra guarantees the database will be scalable, available, and partition tolerant.
TinyURL : Primary Key
LongURL : Secondary URL
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?