Add a distinct type for keys?
- 主要语言
- 没有语言数据
- 星标
- 230
- 派生
- 41
- PR 合并指标
- 30 天内没有已合并 PR
描述
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.
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。