Here is an example scenario to illustrate:
Suppose we have some key=>value pairs:
hmset thing1 name 'a thing' color red
hmset thing2 name 'another thing' color green
hmset thing3 name 'also a thing' color blue
And a list whose values are key names:
lpush things thing1
lpush things thing2
lpush things thing3
My goal is to use indirection to get values from a range of things:
thingsArray = lrange things 0 2
for each thing in thingsArray
result.push(hmget thing name color)
But the penalty for this is extra round trips. I realize this can be mitigated to some extent with pipelining, but was hoping it is possible with just one round trip with a Lua script. So something like:
eval superAwesomeScript 1 things 0 2
The problem is, I wouldn't know which keys will be returned by the lrange call on the "things" list at the time I am calling the Lua script. Does accessing the data in this way in a Lua script violate the rules suggested for future-proofing for Redis Cluster?
I am fairly new to Redis and a total noob with Lua, so if I am way off base in my goals, please tell me so. Also, my main concern with multiple round trips is network io, particularly within a horizontally scaled cluster. So, entirely different solutions would be welcome as well.