I built some lua code that recursively walks a DAG data structure with each node stored in a pair of keys, one holding the metadata, and another holding a list of children. This works great in non-clustered mode and also great in cluster-mode when I use a prefix like “{task}” to force the hash slot.
However according the specs this is verboten. One place in the docs it said that it isn’t enforced so that people can do it in non-clustered mode. Another source said “it may work but Redis could change it any point so don’t do it.” Another said basically “That type of thing has been working for a while and probably won’t break any time soon.”
I rewrote it to follow the rules (using redis.py bindinds) but found that I had a bunch of race conditions. Transactions didn’t seem quite right as the keys aren’t known apriori (recursive).
Any one have thoughts on this?
Above I said a pair of keys. There are actually four. Metadata, two counters for use with INCR, and the child list. I am creating three of the keys programatically from the core key by appending suffixes. Again this breaks the guidelines but seems safe in practice. Thoughts?