This topic describes cluster master-replica instances of ApsaraDB for Redis. These instances help users address the bottlenecks of the single-threading model and increase capacity and performance based on business requirements. Cluster master-replica instances support two connection modes: proxy mode and direct connect mode. You can select a connection mode based on your business requirements.

Proxy mode

By default, cluster master-replica instances run in proxy mode. If a cluster master-replica instance runs in proxy mode, you can connect to the instance by using a unified endpoint (domain name). Requests from clients are sent to the configured proxy servers. Then, the proxy servers forward the requests to the data shards of the instance. The proxy servers, data shards, and config server of the instance do not provide separate endpoints, which 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.

Figure 1. Architecture of a cluster master-replica instance in proxy mode
Table 1. Components of a cluster master-replica instance in proxy mode
Component Description
Proxy server A cluster master-replica instance contains multiple proxy servers. Each proxy server works in a single-node architecture. The cluster master-replica instance automatically balances loads and can fail over among the configured proxy servers.
Note For more information about the features of proxy servers, see Features of proxy servers.
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 service 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 sharding policies of the cluster master-replica instance.

The quantity and configuration of each component in a cluster master-replica instance vary based on the specifications of the instance. You cannot change the quantities or configurations. However, you can change the architecture of the instance. You can also resize the instance by changing the specifications of the instance. For more information, see Overview and Change the specification of an ApsaraDB for Redis instance.

Direct connect mode

The proxy mode simplifies business development but decreases response speeds, because all requests must be forwarded by proxy servers. If you require quick responses, we recommend that you enable the direct connect mode. In this mode, you can bypass proxy servers and directly connect to data shards. This reduces network overheads and increases response speeds. For more information about the architecture of a cluster master-replica instance in direct connect mode, see the following figure and table.

Note Compared with the proxy mode, the direct connect mode does not provide features such as load balancing or proxy query cache. For more information, see Features of proxy servers.
Figure 2. Architecture of a cluster master-replica instance in direct connect mode
Architecture of a cluster master-replica instance in direct connect mode

Before you enable the direct connect mode for a cluster master-replica instance, you must apply for an internal endpoint for the instance. Then, connect to the instance by using the same method that is used to connect to a native Redis cluster. When a client connects to the instance for the first time, the Domain Name System (DNS) resolves the internal endpoint of the instance into a random virtual IP address that is used to connect to the data shards of the instance. Then, the client can connect to the data shards based on 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 an ApsaraDB for Redis instance.

Scenarios

  • Large storage capacity

    Compared with a standard master-replica instance, a cluster master-replica instance supports an expansion of storage capacity to up to 4,096 GB.

  • High QPS

    A standard master-replica instance cannot deliver high queries per second (QPS). A cluster master-replica instance allows you to deploy multiple data shards, which can work together to provide high performance. For more information, see Master-replica cluster instances.

  • Throughput-intensive applications

    Compared with a standard master-replica instance, 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 Redis protocols

    A cluster master-replica instance contains multiple components. Therefore, a cluster master-replica instance has more limits on the support of the Redis protocols than a standard master-replica instance. For more information, see Limits on commands supported by cluster instances.

References

FAQ

Can I enable both the direct connect mode and the proxy mode?

Yes, you can enable both the direct connect mode and the proxy mode.