Is there a way to use MSET for HSET keys ? I am trying to update multiple HSET keys(not fields) in a single operation to save on network traffic.
相关问题
- Getting Redis Master address from Sentinel C#
- Configuring Redis to play nice with AppHarbor
- Why do we need Redis for running CKAN?
- Problem in deserialize redis-cache to objects in S
- wait for all promises to finish in nodejs with blu
No and yes.
No, MSET does not support this behavior, nor does Redis have a command to do that.
Yes, it is possible to update multiple Hash keys with a single command to reduce network traffic - the way to do it is with Lua scripting.
To save on network trips, you'll want to use pipelining. Using Lua is possible, but not as tunable as pipelining where you can find and set the optimum number of commands per execute for your dataset.
And as an added bonus you get experience with a re-usable technique.