RDMS should be enough
add_activity(user_id, activity, goal)
add_goal(user_id, activity_id)
update_goal(user_id, goal_id)
get_activities_to_display(user_id)
get_workout(user_id, activity_id, date)
add_workout(user_id, activity_id)
add_status(user_id)
get_statuses(user_id)
user:
id: UUID string (16 bytes)
activities: FK activity ids
activities_to_display: FK activity ids
statuses: array of status_ids
activity:
id: UUID string (16 bytes)
user_id:
name: string 16 bytes
workouts: array of workout ids
goals: integer 16 bytes
status:
id: uuid
user_id: uuid
blood_pressure: string
weight: integer
date: string
goal:
id: uuid
activity_id: uuid
status: (ENUM ongoing, failed, met)
amount: integer
workout:
id: uuid string 16 bytes
activity_id: uuid 16 bytes
date: string 16 bytes
the client calls a server for all the functions, the server uses a database to update and fetch data.
because of the high volume of writes for adding "workouts" a job queue is used to update the data as not to overload the server.
user uses the app to add or update data, this is sent to the server in a request and then the database is updated.
because of the large volume of requests to add workouts,
The user can also use the app to navigate to a dashboard with all their information which will show data from get_activities_to_display and get_statuses
I'm using an api gateway for authentication and routing, but it makes the app more complex
the app is very simple, but as it expands it could be more complex
if the api gateway goes down then there is a single point of failture
as the application grows we can add more monitoring data