Overview
DTS supports configuring prefix filtering rules for multi-key commands in Redis data migration linkages, making it easier for users to manage keys in their databases.
Key Prefix Filtering Rules
Supports configuring single or multiple key prefix matching rules, with multiple prefixes separated by the Enter key.
When migration rules and filtering rules are used together, filtering rules take precedence over migration rules.
Key Prefix Filtering Rule Examples
1. MSET/DEL/UNLINK commands use exact matching rules.
Migration rule: If a multi-key command on the source matches a single key, only that key is migrated to the target; other keys are not migrated.
Filtering rule: If a multi-key command on the source matches a single key, only that key is filtered and not migrated to the target; other keys will still be migrated.
|
Migration key prefix | MSET dtsnew "111" abcd "222" | dts | MSET dtsnew "111" |
Filtering key prefix | MSET redisnew "111" efgh "222" | redis | MSET efgh "222" |
2. Commands other than MSET/DEL/UNLINK.
Migration rule: If a multi-key command on the source matches any migration prefix, the entire command will be migrated to the target.
Filtering rule: A multi-key command on the source will only be filtered if all keys match the filter prefix. If only one key matches, the command will not be filtered and will still migrate to the target.
|
Migration key prefix | SUNION dtsnew abcd | dts | SUNION dtsnew abcd |
Filtering key prefix | SUNION redisnew efgh | redis | SUNION redisnew efgh |
Filtering key prefix | SUNION redisnew efgh | redis efg | Unsynced |
Directions
To configure a Redis migration task, go to the Set migration options and select migration objects page, check Enable Key Filter, set the filtering rules, and proceed with the subsequent configuration steps.
Was this page helpful?