0
votes

Can a lua script, that is run on one node, get keys from another node in Redis cluster

Example

Node A

  • key1 val1
  • key2 val2

Node B

  • key3 val3

Script

return redis.call('get', 'key1') + redis.call('get', 'key2')

Furthermore are there any attempts to support map-reduce in redis-cluster?

1

1 Answers

0
votes

Unfortunately it is not possible to operate on keys from multiple shards in a lua script - you have to make sure you create your sharding rules so that they will guarantee that all keys involved in your scripts run on single shard. Otherwise you will have to apply the reduce phase by yourself in your client side code.

http://grokbase.com/t/gg/redis-db/136q7m853y/atomicity-of-lua-scripts-against-cluster