users table:
url_map table:
user_to_urls junction table:
Client will connect to the CDN first to see if their frontend has been cached.
Client connects to the LB. If main LB is down, they connect to the backup.
If user is running a request for getUrls, LB pings cache and returns that result
If user wants to generate a new URL, request then moves from cache to the server.
Once it has generated a new mapping, it would save that mapping into the main DB. The main is copied to backup DB.
The server returns the new short url to the cache. Cache saves it. Cache returns it to the LB. Then finally, the url is returned to the client.
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?