Hi,Thanks for reply.I wanted to know is there any way to store hash with lists as values in redis?For example, something like:client.rpush("conversations:"+conversation_id, message);
I wanted to store conversations in format of hash with id [sender_id]#[receiver_id].
That way when someone log in I get all conversations where that user is participant by running throught all conversations. This way I need some time to go thorugh all conversations and get only those for user. How this will affect performance ?
Or second way, maybe better way would be to store messages for user in format:rpush(user_id, {sender: sen, receiver: rec, content: con, timestamo: tmstp})
This way I can easily recostruct all conversations for user and show them when user is logged in.Advantage of this approach is that I need less time to get all user conversations (I get it directly from list), but this takes more space, because same message is saved twice, in sender's and receiver's message list.What you mean, what is better approach?
Thanks in advance
On Monday, September 2, 2013 10:14:04 PM UTC+2, amer wrote:Hi,I implemented chat app for one website using node.js + javascript.Now I need a way to store conversations messages, so when page refreshes, user can see all his conversations.Actually, conversations should be saved based on session. During one server session, user can see all his conversations.When he log out from page, all conversations should be destroyed.I was looking for some king of storage for this messages and find that Redis should do job.I found Redis client for node.js, but I don't understand it quite good.Is the best way to store and retrieve conversations using client put and get methods ?So I don't use publishers and subsribers at all ?And if someone can explain on simple example how subsribers and publishers work?Thanks in advance
--
You received this message because you are subscribed to a topic in the Google Groups "Redis DB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/redis-db/-bv5SdAKdMo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.