Notes/KeyValueStore

KeyValueStore Tools 0.2 Adds a Cluster Rebalancing Planner and Sizes Streams

KeyValueStore has a fifteenth tool. The Cluster Rebalancing Planner reads CLUSTER NODES, works out which slots to move between the primaries of a Redis or Valkey cluster, by slot count or by bytes, and writes a script of the standard SETSLOT and MIGRATE commands. It ran on real clusters of Redis 6.2, 7.4 and 8.10 and Valkey 8.0 and 9.1: every plan ended with exactly the planned owners and all 4,000 keys intact. The review before release caught a case where a key with an empty name could be dropped; the script now refuses to hand over a slot that still holds a key.

The Memory Calculator now sizes streams with consumer groups, and hash fields with their own TTL. Five TTL fields out of 20 in 100,000 small hashes cost about 3 percent more on Redis 8.10 and about 60 percent more on Valkey 9.1, which turns them into hash tables. A new monthly job checks the newest Redis and Valkey patch releases against the recorded data. The release post has the details, and the 0.2.0 package is on GitHub.