tencent cloud

Feedback

Enabling/Disabling Read/Write Separation

Last updated: 2023-10-20 10:57:44

    Overview

    TencentDB for Redis supports read/write separation for business scenarios with more reads but less writes, which can well cope with read requests concentrating on frequently read data.

    Billing

    The read-only replica feature is currently in free trial.

    Note

    Enabling read/write separation may cause data read inconsistency (the data on replica nodes are older than that on the master node). Therefore, you need to check whether your business can tolerate data inconsistency first.
    Disabling read/write separation may interrupt existing connections momentarily, so you are recommended to do so during off-peak hours.

    Prerequisites

    The database instance is on v4.0 or later.
    The database instance is in Running status.

    Directions

    Enabling Read/Write Separation

    1. Log in to the TencentDB for Redis console.
    2. Above the Instance List on the right, select the region.
    3. In the instance list, find the target instance.
    4. Click the Instance ID to enter the Instance Details page and click the Node Management tab.
    5. In the upper right corner of the Node Management page, click
    
    next to Read-Only Replica.
    
    6. In the pop-up window, configure read-only replica nodes. The parameters are as detailed below:
    
    Parameter
    Description
    Account ID
    It is fixed to the Default account; that is, the system can enable read-only replicas only for the default account.
    Command Permission
    It is fixed to Read/Write; that is, the default account has the read/write permissions.
    Read-Only Routing Policy
    It is Replica Node by default. You can also select Master Node or select both Replica Node and Master Node. Read requests are automatically routed to the configured read-only nodes by load balancing.
    Read Local Nodes Only
    This parameter will be displayed if the instance is deployed in multiple AZs. It is fixed to Disabled. You can configure the read-local-node-only parameter on theParameter Settings page in the console to enable/disable this feature.
    Fees
    This feature is current in free trial.
    7. After confirming that the parameter settings are correct, click OK.
    8. The Instance Status will change to Processing. Wait for it to change to Running. Then, in the Specs Info section on the Instance Details page, you can see that Read-Only Replica is Enabled and try out read/write separation.

    Disabling Read/Write Separation

    Note
    If the read-only routing policy of the instance's custom account specifies that read requests are routed to the replica node, the read-only replica feature cannot be directly disabled. You need to change it to route to the master node, and then disable the read-only replica feature.
    1. Log in to the TencentDB for Redis console.
    2. Above the Instance List on the right, select the region.
    3. In the instance list, find the target instance.
    4. Click the Instance ID to enter the Instance Details page and click the Node Management tab.
    5. In the upper right corner of the Node Management page, click
    
    next to Read-Only Replica.
    6. In the Disable Read-Only Replica window, read the note on the impact of disabling read-only replica and click OK.
    7. The Instance Status will change to Processing. Wait for it to change to Running. Then, in the Specs Info section on the Instance Details page, you can see that Read-Only Replica is Disabled.

    Related APIs

    API Name
    Description
    Enables read/write separation
    Disables read/write separation
    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