Redis for chat between users

53 views
Skip to first unread message

Vladimir Kubantsev

unread,
May 18, 2015, 1:08:24 AM5/18/15
to redi...@googlegroups.com
Hi everyone.

I started worked with redis, but I can't understand some concepts. For example: many users chat with each other. Each user has an individual set of messages. Each message has some fields: time, body, sender. How can I efficiently store this structure in Redis?
I have idea create a list like that :

'user_id:inbox' :  'time:body:sender', 'time:body:sender' ... 

But in this case I must parse each record of list for extract fields.

Could you please explain it?

With best regards,
Vladimir

Josiah Carlson

unread,
May 18, 2015, 9:48:34 PM5/18/15
to redi...@googlegroups.com
There are many different ways to implement multi-user chat in Redis. I have posted a couple of them that offer persistent messaging (think WhatsApp group chat or similar), and my book Redis in Action includes a variant in section 6.5.2 in chapter 6.

If you can be more specific about the details of what you actually want to support in your chat, it is likely that I or someone else can provide a pointer or more information on how to implement it.

 - Josiah

--
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.
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/d/optout.

Reply all
Reply to author
Forward
0 new messages