Tair (Redis OSS-compatible) cluster master-replica instances can address the bottlenecks of the single-threading model of open source Redis and provide large capacity and high performance. Cluster master-replica instances support two connection modes: proxy mode and direct connection mode. You can select a connection mode based on your business requirements. This topic describes Tair (Redis OSS-compatible) cluster master-replica instances.
Usage notes
You cannot enable both the proxy mode and the direct connection mode for cloud-native cluster instances.
Proxy mode
If a cluster master-replica instance runs in proxy mode, requests from clients to the instance are sent to the configured proxy nodes. Then, the proxy nodes forward the requests to the data shards. The proxy nodes, data shards, and Configserver of the instance do not provide separate endpoints. This simplifies application development and coding. Proxy nodes automatically balance loads, route commands, and perform failover after they receive client requests. For more information about the features of proxy nodes, see Features of proxy nodes.
For more information about the architecture and components of a cluster master-replica instance in proxy mode, see the following figure and table.
Table 1. Components of a cluster master-replica instance in proxy mode
Component | Description |
Proxy node | Proxy nodes forward requests from clients to data shards. A cluster master-replica instance contains multiple proxy nodes. |
Data shard | Each data shard uses a high availability (HA) architecture in which a master node and a replica node are deployed on different hosts. |
HA service | If the master node fails, the system automatically switches workloads to the replica node within 30 seconds to ensure high service availability and high data reliability. |
The component quantities and configurations on a cluster master-replica instance vary based on the specifications of the Tair instance. In classic deployment mode, you cannot change the component quantities or configurations. However, you can change the specifications or architecture of the instance. For more information, see Change the configurations of an instance and Overview. In cloud-native deployment mode, you can change the number of shards on a per-shard basis within the range of 2 to 256. During the change, the number of proxy nodes is automatically increased or decreased to match the new configuration. For more information about how to change the number of shards, see Adjust the number of shards for an instance.
Direct connection mode
In direct connection mode, you can connect to a Tair instance in a similar manner as you connect to an open source Redis cluster. The first time a client connects to the instance, the Domain Name System (DNS) resolves the private endpoint of the instance into a random virtual IP address (VIP). Then, the client can connect to the data shards of the instance over the Redis Cluster protocol. For more information about the architecture of a cluster master-replica instance in direct connection mode, see the following figure and description.
The direct connect mode and the proxy mode are significantly different from each other. For information about the usage notes and usage examples of these connection modes, see Use a private endpoint to connect to an instance.
Scenarios
Large volumes of data
Compared with a standard master-replica instance, a cluster master-replica instance supports a storage capacity of up to 16 TB (65 GB × 256 shards).
High request load
A standard master-replica instance cannot support high request load. A cluster master-replica instance allows you to deploy multiple data shards. These data shards can work together to eliminate the performance bottlenecks of the single-threading model used by open source Redis. For more information, see Cluster master-replica instances.
Throughput-intensive applications
Compared with a standard master-replica instance, a cluster master-replica instance can linearly scale its throughput over an internal network by increasing the number of shards. This allows you to efficiently read hot data and manage high-throughput workloads.
Applications that involve few multi-key operations
Cluster master-replica instances use a distributed architecture. In a distributed architecture, operations involving multiple keys can be limited due to the requirement that all keys must reside in the same slot. For more information, see Limits on commands supported by cluster instances and read/write splitting instances.
References
For information about how to analyze the distribution of data in memory, see Use the offline key analysis feature.