I am designing chat within my mobile application. I am using firebase to power the chat.
The chat system has multiple isolated teams and data is de-normalized to ensure that we get only the required data without any deep nesting.
The high level current schema I have is as below :
The issue I see in this schema is how to handle the update scenarios. The main update scenarios I am seeing are :
- User updates the display name (user_alias)
- Group names are changed
If user changes the name, then all the messages needs to be updated. Also all the direct message channels needs to show the updated user profile name
Similarly if group names are updated, we will need to update all the user_channels
What would be a better design to handle the update scenarios?
One option I can think of is using an address book so that I can look-up based on the user-ids. Any suggestions will be helpful.