Home > database >  Chat recently contact function (there are also a one-to-one chat group chat) database how to design
Chat recently contact function (there are also a one-to-one chat group chat) database how to design

Time:09-26

Now to do a chat program in recent contacts that recently the function of the session, including friends chat and group chat at the same time, the recent session said separate now, table structure is
Send_uid sender id to_uid recipient id last_msg last_time latest time last information, in order to launch a one-to-one session state chat uid1, uid2 will correspond to generate two data so that at the time of query their recent session just check to_uid current uid=data can, but now have a group chat, there may be 200 people in a group, when someone talk I don't want to generate the corresponding 200 messages there are too many redundant database pressure is most likely the data before the road design ask again, consult everybody have any good ways to design a database or implementation

CodePudding user response:

The receiver ID, this ID can be individuals, is also what hurt heart, this is about the same
  • Related