List functional requirements for the system (Ask the chat bot for hints if stuck.)...
List non-functional requirements for the system...
Assuming 10: 1 read to write ratio.
Everyday we have 1M reads, this will give 30M reads per month and 360M reads per year. Assusming a shortened url will expire in 5 years, since we have 10: 1 ratio, so writes will be 36M. Now, assuming we will store 1Kb data per record, this will give us:
1KB * 36M * 5 = 180 GB of data stored
Also we will have 100 reads/sec
As we can see that the application is read heavy. So it is very essinitial to scale out as the requirement for the reading grows. And we know that a nosql db will be very useful in our case. Also we should replicate our data across multiple instances of DB and use the replicas only for reading the url and not the primary db. So that the load is distributed. So we will be using mongo db for storing the records with schema.
Also we will use redis as key value store for our caching as redis is fast and scalable
POST: '/'
Following are the schemas that will be used:
URL table:
User table:
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?