tencent cloud

Feedback

Key Prefix Filtering

Last updated: 2024-11-26 11:24:29

    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.
    Prefix Type
    Source Database Key Command
    Prefix Set in DTS
    Result on Target
    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.
    Prefix Type
    Source Database Key Command
    Prefix Set in DTS
    Result on 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.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support