Database schema for messaging to multiple users

后端 未结 2 1029
旧巷少年郎
旧巷少年郎 2021-02-06 19:55

I\'m looking for the best solution to implement messaging to multiple users within the system(Facebook-style).

I\'m came up with the following idea: where each Message

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-06 20:18

    My solution is to avoid the massive data storage by using more programming to determine which message goes to whom.

    For example if you want to send a message to all users of the system, you place a "" in the usr_id column, and then programmmatically you could fetch all messages where the usr_id = current_usr_id OR ''. Then you could do a variety of filters and come up with your own syntax for creating messager_user lists without database storage.

    Seems like a trade-off between processing/storage ...

提交回复
热议问题