国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Mysql database design - chat record table design
M?r.?z?h?a?n?g?
M?r.?z?h?a?n?g? 2020-04-21 12:12:14
0
2
1802

I would like to ask all the experts, how do you design the chat database? Those who have experience can talk about their experience, and those who have no experience can discuss it together.

Current problems encountered:

Assume

There are 1,000 people in the group chat, and user a sends a message:

Then:

Plan A: Insert a record corresponding to 1,000 people in the group chat (required Insert 1000 records, very scary)

Plan B: Insert a record (the user has read it, how can the user delete a record? Add a corresponding relationship table??)

Others Solution: Use other storage methods, such as Redis, memecache, etc.? ?

M?r.?z?h?a?n?g?
M?r.?z?h?a?n?g?

reply all(1)
一錘一座山

Memcached stores, and gives a mark to record the amount of data currently saved. When the number of pieces of data is satisfied, it will be inserted into MYSQL uniformly, return the success status, and clear the data saved by Memcached.

  • reply Great God
    Guanhui author 2020-05-04 11:29:02
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template