For the user service we are talking about unlimited users. Bear in mind, not everyone will sign up for the service, most users would probably just use the shortening url service. So we need a database that should be able to scale vertically. We can start assuming that 100k users would be the first iteration, and based on how the product gets adopted.
Writing should be a fairly congested operation. If we have 100k users, averaging between 5 to 20 writes per month, then lets aim for 200k writes per month, to have capacity for power users.
Reading though, that should be even more. Users will enter a URL just once, and this will generate a shortened one that will be read many times (normal reads, browser refreshing, rage refreshing). If we are talking about 100k users, averaging 20 reads per month as a baseline, then that makes it 2.000.000 reads.
v1/users/signup
Sends
v1/users/login
Sends
Returns
v1/users/getAccount
Sends
Returns
v1/urls/generate
Sends
Returns
Users should be stored depending on their region, as different regions might have different privacy laws. we can shard the user db per region for future scaling implications.
User
Session
Url
Account
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?