antirez / antirez/RESP3

Add a distinct type for keys?

Ouverte
#29 5 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Aucune donnée de langage
Étoiles
230
Forks
41
Métriques de merge des PR
Aucune PR mergée en 30 j

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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.