search

Home  >  Q&A  >  body text

java - How to save unread chat messages using redis, and how to do it more reasonably.

How to save unread chat messages using redis. I used to use lpush to save. keys is the ID of the person who has not read the message, and vlaue is the object. All unread messages sent to this person are saved in this collection. There is a flaw. After reading the unread messages, I want to delete the read messages. Other people's chats are also deleted. Now I want to improve it, but I don't know what way to solve it. Thanks for informing.

PHP中文网PHP中文网2757 days ago1378

reply all(1)I'll reply

  • 黄舟

    黄舟2017-06-21 10:13:46

    I am used to using zset to store messages, because not only one person sends messages to him, but the recipient is also likely to click on the messages in random order

    reply
    0
  • Cancelreply