antirez / antirez/RESP3

Add a distinct type for keys?

Open
#29 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
230
Forks
41
PR merge metrics
No merged PRs in 30d

Description

Hi,

According to http://antirez.com/news/125 the goal with RESP3 is to be able to have relatively dumb clients which offer a very simple interface such as `result = redis.call(“GET”,keyname);` and don't need to know anything about the command it sends.

As the current maintainer of `redis-rb`, I'm totally behind this as it would indeed make my life much easier, and I'm really eager to be able to delete tons of code.

However I question wether such simplicity will really be achievable in practice. With a regular Redis setup it will indeed be possible, but as soon as you use Redis in a distributed manner, say with Redis cluster, the client do need to know which elements of the command are keys, so that it can hash them and select the proper target.

So ultimately I'm afraid the client will still have to maintain a list of commands, as well as their possible arguments as to be able to extract keys.

Hence why I wonder if `keys` could be a distinct type from strings, with their own prefix such as `#` or `@`.

This way, rather than `redis.call("GET", "foo")`, the interface would be something like `redis.call("GET", redis.key("foo"))`, allowing the client to extract the keys without having to know anything about the command signature.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.