07:10:49 GMT hi, i want to know the memory taken by keys, i run "redis-cli --bigkeys", but it seems by default it selected only database 0. how do i run the same command for database 4?? please help... 07:11:59 GMT P.S. - i run this command on ubuntu 14.04 07:13:25 GMT no need to reply i got it 18:32:08 GMT Hey guys, what would be a low complexity approach for a private messaging system? 18:32:34 GMT I'm thinking about creating chat sessions, place them into a set like so: user:1:chats = [...] 18:33:02 GMT And each chat session contains a LIST of a small JSON entry. (sender, message, timestamp etc.) 18:33:24 GMT Is there a smarter way? 18:33:25 GMT sounds familiar; were you here before? 18:33:50 GMT I've been into this channel time to time, but never asked this question before 18:34:35 GMT Thinking about some tricky like relying on sorted sets and keeping the key as timestamp of message 18:35:25 GMT sounds sensible 18:38:04 GMT I'm also worrying about having to decode strings into JSON literals each time 18:38:18 GMT Cause, what I get from Redis is a string representation of a JSON object 18:38:45 GMT I guess I cannot place stuff like hashes inside sets, right? 18:38:54 GMT Like a JS array containing objects 18:40:07 GMT Actually, I can offload that task to my client I guess 18:40:23 GMT What about this issue, minus 18:40:51 GMT My chat contains a JSON string like so: { sender: 1, receiver: 5, message: "Hello", timestamp: 13123123213 } 18:41:33 GMT Then I have to replace sender: 1 with redis.hgetall(`user:${res.sender}:details`) 18:41:45 GMT so I can access his avatar, email and other information 18:41:47 GMT Aristona: you can't nest data types, no 18:42:16 GMT The complexity of it would be o(n) I guess, where n is the amount of unique users in a chat session 18:43:17 GMT maybe redis is the wrong thing to store users? 18:43:32 GMT then again you're just storing basic metadata 18:43:32 GMT I just store basic information such as email, avatar and other things 18:46:06 GMT If there are 10 users in a chat room, then I have to do 10 HGETALL commands to obtain each user's information. Can it be done in a smarter way? 18:47:29 GMT not really 18:47:45 GMT you could serialize and dump that info into a set per channel 18:48:03 GMT so it's just one SMEMBERS 18:49:20 GMT Uhm, how exactly can I do that? 18:49:32 GMT I don't think I can store HGETALL's response in a set 18:49:39 GMT Not sure if I understood you correctly 18:51:30 GMT you can if you serialize it to json 18:53:38 GMT And update that SET each time someone enters/leaves the chat session? 18:53:50 GMT It will act like a front cache if I understood correctly 18:55:40 GMT yeah 18:55:58 GMT okay, sounds logical 18:56:30 GMT i wouldn't do that from the beginning though, since it does come with some complexity 18:58:20 GMT Yeah :)