Redis: Optimizing for Roundtrips
Nifty one from Trenton Strong:
Using
SORTandGETis fairly straightforward. We can point theSORTcommand at lists and sorted sets and retrieve the contents in specified order. If we use theGETclause, we can specify a pattern for keys external to the list that we would like to retrieve instead of the sorted list contents. So now we can finally dereference our references!redis> SORT FooBar|list BY nonexistentkey GET FooBar|id|*
Before knowing this one, I’d be looking for:
- variadic commands (
SADD,ZADD,LPUSH,RPUSH,HMSET) available since Redis 2.4 - Pipelining
- MULTI/EXEC: available since Redis 1.1.95
- the upcoming Lua support
Original title and link: Redis: Optimizing for Roundtrips (©myNoSQL)
via: http://trentstrong.com/blog/2011/using-redis-sort-get-save-roundtrips.html