Replies: 1 comment
|
Short answer: no — For exporting a subset, the supported primitives are Enumerate the subset without blocking — Export each key's exact serialized value with
Move specific keys atomically to another instance in one shot with On your actual concern — "
So: no selective |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Background
In large Valkey deployments, it is sometimes need to extract a subset of keys based on a custom condition (for example, a hash applied to the key name), while minimizing impact on the running instance.
Using
SCAN(or similar keyspace iteration) doesn't seem to be ideal in this case, as it still requires iterating over the entire keyspace and may take a long time or introduce overhead when the number of keys is very large.Commands like
BGSAVEandPSYNCare attractive because they use background processes and allow dumping data efficiently without significantly slowing down Valkey’s main operations. However, they currently dump all keys, which then requires additional post-processing to filter the keys of interest.Question
I’m looking for a way to extract only a subset of keys that satisfy a specific condition from a snapshot taken at a point in time, ideally without scanning the entire keyspace by
SCANcommand in the main Valkey process.For example, consider a scenario like:
At the moment, the options seem to be:
My questions are:
Thank you for the reading. Any guidance or confirmation would be greatly appreciated.
All reactions