--
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+unsubscribe@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.
Itamar Haber | Chief Developer Advocate
Redis Labs ~/redis
Mobile: +972 (54) 567 9692
Email: ita...@redislabs.com
Twitter: @itamarhaber
Skype: itamar.haber
Hello zhangkai,Always prefer using multi-key commands - they are faster.Your question suggests that you're storing terminals as strings using some serialization. If that is the case, consider using a Hash which is more suitable for this type of data. With Hashes, each key represents a terminal and the fields of that Hash value are the properties and their respective values. Read a specific field, multiple fields or all fields from a Hash using `HGET`, 'HMGET` and `HGETALL`, respectively. To write a value or multiple values call on `HSET` or `HMSET`. In your case, this will save you from the need to read the entire thing, decode it, make a modification, encode it and write it back.If you stick with serialized strings, Lua is probably the better choice because you can unpack and pack in the script (trivial if you're using a standard like JSON or messagepack). If you use Hashes, Lua may still offer an edge on pipelining because it will also save some of the network traffic's volume.
On Wed, Nov 23, 2016 at 4:25 AM, Kai Zhang <zhangk...@gmail.com> wrote:
Hello all,I am a newbie to Redis,My redis store terminal infos such as id, name, status, property etc.There are many terminals will update it's status.But some "fixed“ info will not be modified.So I need to read the terminal info first, then modify the status and key the fixed properties then I will rewrite the redis.What is the best practices for this situation? mget? mset? pipe ? lua script?many thanks,zhangkai2016.11.23
--
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 https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+unsubscribe@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.