Hello Oleg, if you want to maintain a limited history (like latest N
lines of chat between every two users) the list can be a good pick.
I would use a more memory efficient storage in which every line is
something like "<id>:<time>:message bla bla bla". You can use the key
itself in order to "tag" the two users chat id.
You can have a rule that if user ID X and Y are chatting, you always
order X and Y so that the minor of the two is the first ID, and then
call the key chat:ID1:ID2 or alike.
Every time the user writes something new to the other user, you just
do an RPUSH on the list. Since lists support blocking ops this is also
a good setup to block and serve the client, but you could also use
Redis Pub/Sub for the delivery.
Salvatore
> --
> 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/groups/opt_out.
--
Salvatore 'antirez' Sanfilippo
open source developer - GoPivotal
http://invece.org
To "attack a straw man" is to create the illusion of having refuted a
proposition by replacing it with a superficially similar yet
unequivalent proposition (the "straw man"), and to refute it
-- Wikipedia (Straw man page)