1: sometimes, yes; it can reduce round-trips and bandwidth, but it isn't applicable for every situation - and you certainly don't want a script looping (etc) for too long as it will block all other connections. It has good use-cases and bad use-cases
2+3 yes, but you need to be careful to declare keys in the KEYS argument. You probably also want to use key has tags - declaring the KEYS doesn't help if they aren't on the same node. Hash tags take the form of "{/user/12345}/followers" and "{/user/12345}/account" - here we can guarantee that these hash to the same slot (which means: same node, assuming it isn't in migration)
Marc
--
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/d/optout.
/s/has tags/hash tags
Hi
I have few questions about Redis with Lua script.
1. It seems using Lua script has some advantage over multiple commands and pipeline. So is it a recommended way to query Redis?
2. Will Lua script still being supported/recommended in Redis 3.x, espcially in Cluster Mode?
3. I understand EVAL command request user pass KEYS along with the Lua script, mainly effort to support Redis cluster.
Take this examle: Let's say I have a twitter clone. A user has a follower key which is a Set contains followers's id.
When user post a new tweet, my script will loop the follower key and calculate each follower's timeline key, then add the tweet to them.
So the command should be: EVAL post_tweet_script 1 user_a_follower_key
I didn't pass any follower's timeline key to the command, will it be a problem in Redis Cluster or something else?