What is the structure for saving chat history in Redis

I am writing a chat program and I want to do chat history, so I need to store some values. First, these are data such as:

 {chat_post_id,text,room_name}

      

where chat_postid will automatically grow and the text and roon_name I get from the chat. After collecting some messages, I need to associate them somehow with the user who wrote them, so I need something like this:

 Thomas
   chat_postid_1,text,room_name
   chat_postid_2,text,room_name
   chat_postid_3,text,room_name
 Kris
   chat_postid_1,text,room_name
   chat_postid_2,text,room_name
   chat_postid_3,text,room_name

      

I'm not sure if this is possible with redis - I'm new to this nosql database concept. I think I am using hashes in some way, but have no idea how.

+3
node.js express redis


source to share


No one has answered this question yet

Check out similar questions:

1688
What is the -save option for npm install?
301
MISCONF Redis is configured to store RDB snapshots
285
What are the main data structures used for Redis?
12
How can I manage multiple chats with socket.io?
7
Why use redis in a chat application?
4
How do I create a chat app with nodejs, redis and mongodb?
2
Storing messages for chat.js in redis. How?
1
Use redis to create live chat with socket.io and NodeJs
1
Structure type for storing private chat in Redis
0
Storing chat messages with Redis + Other database



All Articles
Loading...
X
Show
Funny
Dev
Pics