All Products
Search
Document Center

Tair (Redis® OSS-Compatible):Enable read/write splitting

Last Updated:Mar 28, 2025

Tair (Redis OSS-compatible) provides the read/write splitting feature. After you enable read/write splitting for an instance, the instance can automatically identify read and write requests and forward them to corresponding nodes. This allows the instance to support high-concurrency read and write operations.

Overview

  • The read/write splitting feature uses the star replication architecture where all read replicas synchronize data from the master node. This reduces synchronization latency.

  • All read replicas come equipped with disaster recovery capabilities and can serve as replica nodes for data backup. You can select the number of read replicas based on your needs.

  • After you enable the read/write splitting feature for a dual-zone instance, the instance provides the endpoints of the primary and secondary zones. Both endpoints support read and write operations. Write requests are routed to the master node in the primary zone. Read requests are routed to the master node or read replicas within the same zone from which the requests originated. This ensures that the requests are handled by the geographically closest nodes and thus reduces request latency.

Prerequisites

  • The instance is deployed in cloud-native mode.

  • The instance is a Redis Open-Source Edition instance or a Tair (Enterprise Edition) DRAM-based or persistent memory-optimized instance.

  • The instance comes with at least 1 GB of memory.

  • The instance uses the master-replica architecture to ensure high availability.

Precautions

This operation may cause transient connections that last for a few seconds on the instance and trigger data migration in the background. Perform this operation during off-peak hours. Make sure that the instance does not receive a large number of write requests during the operation and that your application can automatically reconnect to the instance.

Procedure

  1. Log on to the console and go to the Instances page. In the top navigation bar, select the region in which the instance that you want to manage resides. Then, find the instance and click the instance ID.

  2. In the left-side navigation pane, click Node Management.

  3. Enable the read/write splitting feature.

  4. In the panel that appears, confirm the instance configurations and order fee. Then, click Pay.

    Note

    The specifications of new read replicas are the same as the specifications of the instance.

  5. Complete the payment.

    After the payment is complete, the instance enters the Changing Configuration state. Wait for 1 minute to 5 minutes. If the configuration change is complete, the instance enters the Running state. You can check the instance status on the details page of the instance.

Customize the number of read replicas for a read/write splitting instance

On the Node Management page of a read/write splitting instance, click Modify in the Actions column to adjust the number of read replicas. The number of read replicas ranges from 1 to 9 in a standard instance, and 1 to 4 in each shard of a cluster instance.

Note

We recommend that you configure at least two nodes in the primary and secondary zones for a dual-zone instance:

  • Primary zone: one master node and one read replica

  • Secondary zone: two read replicas