Should I include full key names
This is a recommended practice.
I would violate some specifications
No, the specifications do not indicate that key names should be explicitly passed. The KEYS / ARGV engine was put in place to prepare for the cluster, but before the cluster actually became. Hash tags were not part of the cluster structure at the time, so the recommendation was to avoid hard coding / dynamic generation of key names in scripts, since there is no certainty that they will be in the same cluster hash slot.
Your approach is absolutely correct and will work as expected. I want to emphasize that this makes sense only if you control a large number of so-called {UNIQUE_HASH_TAG} s, otherwise you will only beat a few slots, which can become a scalability problem.
EDIT . That being said, you really should always explicitly pass the key names to the script, and not cheat. Until it is locked, this unspecified behavior may change in the future and cause your code to crash.
Itamar haber
source share