Tair provides cluster master-replica instances that can eliminate performance bottlenecks caused by the single-threading model of open source Redis. You can use high-performance cluster instances to process large-capacity workloads. 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.
Precautions
You cannot configure both proxy mode and direct connection mode for a cloud disk-based cluster master-replica instance at the same time.
Proxy mode
In proxy mode, you can connect to a Tair cluster master-replica instance by using a unified endpoint (or domain name). Requests from clients are sent to the configured proxy nodes. Then, the proxy nodes forward the requests to the data shards of the instance. The proxy nodes, data shards, and config server of the instance do not provide separate endpoints. This simplifies application development and coding. For more information about the architecture and components of a cluster master-replica instance in proxy mode, see the following figure and table.

Component | Description |
---|---|
Proxy node | A cluster master-replica instance contains multiple proxy nodes. Each proxy node works in a single-node architecture. The cluster master-replica instance automatically balances loads and can fail over among the configured proxy nodes.
Note For more information about the features of proxy nodes, see
Features of proxy nodes.
|
Data shard | A cluster master-replica instance contains multiple data shards. Each data shard works in a high availability architecture in which a master node and a replica node are deployed on different hosts. If the master node is faulty, the cluster master-replica instance fails over to the replica node to ensure high availability. |
Config server | The config server of a cluster master-replica instance works in a high availability architecture in which a master node and a replica node are deployed. The config server stores the configuration data and partitioning policies of the cluster master-replica instance. |
The component quantities and configurations in a cluster master-replica instance vary with the specifications of the Tair instance. You cannot change the quantities or configurations. However, you can change the specifications and architecture of the instance. For more information about instance specifications, specification change, and architecture change, see Overview, Change the configurations of an instance, and Overview.
Direct connection mode
The proxy mode simplifies application development but decreases the response speed of Tair because all requests must be forwarded by proxy nodes. If you require quick response, we recommend that you enable the direct connection mode. In this mode, you can bypass proxy nodes and directly connect to data shards. This reduces network overheads and increases response speed. For more information about the architecture of a cluster master-replica instance in direct connection mode, see the following figure and description.

In direct connection mode, you can connect to a cluster master-replica 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 by using the Redis cluster protocol. The direct connect mode and the proxy mode are significantly different. For more information about the precautions and examples of these connection modes, see Use a private endpoint to connect to a Tair instance.
Scenarios
- Large amounts of data
Compared with a standard master-replica instance of Tair, a cluster master-replica instance supports a storage capacity of up to 4,096 GB.
- High QPS
A Tair standard master-replica instance cannot support high queries per second (QPS) scenarios. A Tair cluster master-replica instance allows you to deploy multiple data shards. These data shards can work together to eliminate the performance bottleneck of the single-threading model. For more information, see DRAM cluster instances.
- Throughput-intensive applications
Compared with a standard master-replica instance of Tair, a cluster master-replica instance provides higher throughput over an internal network. You can efficiently read hot data and manage high-throughput workloads.
- Applications that do not require high compatibility with the Redis protocol
A cluster master-replica instance contains multiple components. As such, cluster master-replica instances are not as compatible with the Redis protocol as standard master-replica instances. For more information, see Limits on commands supported by cluster instances.
References
- For more information about how to troubleshoot abnormal memory usage of data shards in a cluster master-replica instance, see Identify and handle large keys and hotkeys.
- For more information about how to analyze the distribution of data in memory, see Offline key analysis.