REDIS GET

46 views
Skip to first unread message

Santos Das

unread,
Jul 16, 2017, 3:54:05 AM7/16/17
to Redis DB
Hi,

I am storing like this,


Key1 --> Val1
Key2 --> Val2

Actually, Key2 is nothing but Val1. My interest is given Key1, get Val2. I am doing this in two separate GETs. Is there a way where I can do this using a single GET.

Thanks, Santos

Marc Gravell

unread,
Jul 16, 2017, 3:57:45 AM7/16/17
to redi...@googlegroups.com
you could write a Lua script that does the indirection at the server, and use EVAL / EVALSHA ?

--
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

unread,
Jul 16, 2017, 4:29:25 AM7/16/17
to Redis DB
@Marc - I love you, you know that, but that's not the answer. You should explicitly pass any keys that you touch in the script as arguments (the KEYS table). Do not hardcode/generate/read them.

@Santos - no, there isn't. The real question is, however, why are you doing this key "dereferencing" and whether it is actually needed.

Cheers,
Itamar

Marc Gravell

unread,
Jul 16, 2017, 5:30:58 AM7/16/17
to redi...@googlegroups.com
hmm, yes, good point on the key touch. caveat: it should be OK if the same cluster shard key magic notation applies to both, but indeed: in the general case, it would be bad practice. Thanks for keeping me honest :)

Itamar Haber

unread,
Jul 17, 2017, 7:39:26 AM7/17/17
to Redis DB
Cluster hash tags are beyond magical - they're the silver bullet and much more, agreed.

Thanks for keeping us in shape :)

Itamar Haber | Chief OSS Education Officer
Redis Labs ~/redis

Mobile: +972 (54) 567 9692
Twitter: @itamarhaber
Skype: itamar.haber

Santos Das

unread,
Jul 18, 2017, 2:55:44 AM7/18/17
to Redis DB
Thanks Guys.

Regards, Santos
Reply all
Reply to author
Forward
0 new messages