I need to design a simple structure where the user’s click actions on a web application are recorded. Example document,
user_action
{
objectId: 90rt93jkfd92,
action: analyze,
app: reply,
user:{
id: 5
name: Sandy,
email: sandy@xyz.com
}
}
I also have a user_detail collection where user detail is stored.
If some user updates their user_detail say the first name, it should be reflected in the user_action data.
Which approach is best?
-
Update the user_action collection when user detail is updated. user_action is the largest collection in the DB where all actions are recorded. Is it ok to modify such a large no. of documents though not frequently?
-
Join fetch user_detail while querying user_action. Is this approach is right?
-
Consider redesigning the model. If I need to redesign the model, what are some suggestions?
Is there any other way to approaches this.
Your help would be appreciable.
Thanks in advance!