Given a URL, we'll compress it into a shorter one
Loadbalancer from clientside to server
Shard database by first character by URL's root domain
Use replicas -> If url has already been shortened then grab existing shortened URL
URL length 2000-3000 characters long
External:
Shorted URL Table:
ShortenedURL(Str) -> Hashed from backend
OriginalURL(Str, PK) -> Passed to API from clientside
User inputs a URL, clientside sends to server
Serverside hashes the URL and stores in DB
User -> Clientside -> Server
Server side:
Explain any trade offs you have made and why you made certain tech choices...
Too many requests at time or might be straining on DB to have so many transactions with it
This is why we use a replica
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?