Availability:
Consistency:
Performance:
Scalability:
Durability:
Security:
If we build this in the cloud, we can scale to need.
readURL will be done with DNS
Pretty much just columns for each of the parameters: short, long, expiration date. Databases like Dynamo and Spanner can do expiration for us.
The authoritative mapping of short URLs to longURLs will be in a scalable database like DynamoDB or GCS Spanner.
Reads will be done via a load balanced DNS server. Reads are trivially cache-able, so DNS servers will have a cache
Writes go to a write webserver fleet, with autoscaling
read short url:
DNS request -> DNS server -> cache
OR
DNS request -> DNS server -> database (eventually consistent read)
write short url:
createURL -> creationService -> write to DB -> creationService -> user
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?