Efficient data structure for storing related contacts in Mobile Chat

We are creating a chat application that has a lot in common with WhatsApp, Viber and Line ...

One of the problems that we want to solve is to inform specific users about the action that occurred on the server. More specifically, if user X changes his display name (or image), users W, Y, Z should be aware of the change.

Users W, Y, Z must be aware of the change because X the new display name must be displayed in the chat group and in the creation of the chat group (when adding users from telephone contacts).

It seems that the only solution to this problem is to preserve some data structure that associates the given userId with a list of other userIds. This data structure will be updated when the user registers with the application, and all his contacts will be sent to the server.

  • Is there a recommended / proven way to save such data (maybe?)?

  • Can we avoid storing all this data?

Help on the topic / architecture would be greatly appreciated.

+4
source share

All Articles