hmset c1:1 id 1 attr1 val1 attr2 val2
hmset c1:2 id 2 attr1 val1 attr2 val2
hmset c1:3 id 3 attr1 val1 attr2 val2
hmset c2:1 id 1 attr1 val1 attr2 val2
hmset c2:2 id 2 attr1 val1 attr2 val2
hmset c2:3 id 3 attr1 val1 attr2 val2
Now I have sorting/filtering use case (user should be able to sort on any of the above attribute ), so have started keeping one set which contains only key information. I am calling this key as "idset".
sadd c1:idset c1:1 c1:2 c1:3 ( keeps key for all c1 entity)
sadd c2:idset c2:1 c2:2 c2:1 ( keeps key for all c2 entity)
With this I will be able to sort of any parameter and get all details about entity with following CLIs ( UI will be displayed this information in tabular format)
sort c1:idset asc by *->id GET *->id GET *->attr1 GET *->attr2 ( Sort by id) [ sort by id for c1]
sort c2:idset asc by *->attr1 alpha GET *->id GET *->attr1 GET *->attr2 ( sort by attr1 for c2)
and so forth....
Now I have business requirement which allow to access only "c1" or "c2" at a time. So in my client I can precisely construct the above command. That's the reason I have kept one "idset" set per "c*".
With this I would like to keep one "c*" at one node.
node1 can have following -
hmset c1:1 id 1 attr1 val1 attr2 val2
hmset c1:2 id 2 attr1 val1 attr2 val2
hmset c1:3 id 3 attr1 val1 attr2 val2
sadd c1:idset c1:1 c1:2 c1::3
Node2 can have following -
hmset c2:1 id 1 attr1 val1 attr2 val2
hmset c2:2 id 2 attr1 val1 attr2 val2
hmset c2:3 id 3 attr1 val1 attr2 val2
sadd c2:idset c2:1 c2:2 c2:3
So that I can make sure that whenever I run the sorting for any "c" ( c1/c2/cn), all the relevant data in one node. With Cluster behavior I might have key distributed across nodes for same c1 as it works on whole key hashing. So this will not work.
I hope I have explained it cleanly. I am open for changing the existing implementation.
Looking forward to hear more ideas/thoughts.
Dipak
--
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.
I read in twitter that after talking to @Yiftachsh you are considering to implement hash slots on redis cluster.
Would that allow us to use multi-key operations on cluster assuming only performing these operations with keys with the same hash-slot?
i.e:
SADD key1{shard1}
SADD key2{shard1}
SUNION key1{shard1} key2{shard1}
Thanks in advance.