APIs used by the user:
It would be better to use a NoSQL database since availability would be more important than consistency and to scale horizontally to help with the 20% increase in users every year. For faster retrieval, we can cache data for the user.
The user will interact with the user to retrieve data.
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...
One important component is the user engagement component. When the user logs a new activity into the app we will keep track of this time and the day of the week. Most people have daily routines, so it is safe to assume that the user will perform that activity around the same time on that day of the week. We will send a reminder for that time every day to track their activity.
Explain any trade-offs you have made and why you made certain tech choices...
The biggest tradeoff here is the database. I chose a NoSql database in order to keep up with the growing active users and to be able to have more availability over consistency.
Try to discuss as many failure scenarios/bottlenecks as possible.
If we have a spike in users, we do have a SPOF with the load balancer.
Something else I can see being an issue is the user trying to update an activity or goal and not seeing it update until a few seconds versus ms which would be done with a SQL database.
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?
We could add more load balancers that each have health checks to help combat the SPOF.
Adding more features like a social aspect would be great but would require a lot more RPS. It would be easy to scale horizontally for this feature since we decided to use a NoSQL database.