User is able to record the workouts
User set goals based on pair of frequency and workout
Dashboard to check progress, based on workout type and ratio of completion at current time interval (day or week)
Some other things like intake/calories tracking, sharing will not be covered
High availability: users should be able to access the app whenever they want
Low latency: users should get immediate display when track progress
Durability: once workouts are uploaded, data is not lost
Consistency: eventual consistency since the data freshness is not critical
Total users: 10 millions
DAU: 1 millions
QPS:
Storage:
Typically, we're not looking at complex calculation, and thinking about 700GB per year scale and write heavy at peak hour, noSQL for example Cassandra is a good choice with flexibility and Horizontal scalability.
Collections are as the class diagram
The system typically focuses on two type of use cases, thus three key components has to be separate services: ActivityService, GoalService, UserService, data are persistent into Cassandra while cache can be used to improve all services' performance, please see High-level diagram
Explain how the request flows from end to end in your high level design. Also you could draw a sequence diagram using the diagramming tool to enhance your explanation...
The ActivityService may fail at any stage, for example that it successfully publish into the queue, and fail the db writer, we can configure the retry policy to the queue and allows the DB writer to process the event at later time, up to a max retry times, we can use a DLQ to store the events for later manual processing
We can setup regional server instances, even regional load balancers in front of all service clusters in any region, on one hand, it improves the performance that edge servers serves requests quicker, and on the other hand, it brings high availability, that can failover request to other regions
we can have a sequence batch process at any tier an point of the system to improve the throughput, also monitoring service should be integrated to generate metrics for all the instances about resource utilisation so that services can scale more efficiently, also enabling logs helps to do any PIR. Annual review to check the system against hundreds of questions to find operational gap as system are varying along the time since load may change, new features may be introduced, and security patches.