The cluster master-replica instances of ApsaraDB for Redis can resolve the performance bottleneck caused by a single-threading model. You can use the instances to process large-capacity or high-performance workloads. Cluster master-replica instances can run in either proxy or direct connect mode. You can select one based on your business needs.

Proxy mode

By default, cluster master-replica instances use the proxy mode. In this mode, you can access ApsaraDB for Redis clusters by using a unified endpoint (domain). Requests from clients are forwarded to each data shard by using a proxy server. To simplify application development and code, proxy servers, data shards, and config servers do not provide separate endpoints. The following sections describe the architecture and components for the proxy mode.

Figure 1. Architecture of an ApsaraDB for Redis cluster instance in proxy mode
Table 1. Components of an ApsaraDB for Redis cluster instance in proxy mode
Component Description
Proxy server Each proxy server is configured with a single node. A cluster instance contains multiple proxy servers. The system implements load balancing and failover for the proxy servers.
Data shard Each data shard runs in a high-availability master-replica architecture. If the master node fails, the system switches the workloads to the replica node to ensure high availability.
Config server A config server stores configuration data and sharding policies, and runs in a high-availability master-replica architecture.

The quantities and configurations of instance components depend on the specifications that you select when you create a cluster instance. You can use Modify instance configurations to modify the size of the cluster instance, or select another architecture type. For more information about architecture types, see Overview.

Direct connect mode

The proxy mode simplifies business development but slightly deteriorates the service response speed, because all requests are forwarded by proxy servers. If you require high response speed, use the direct connect mode. In this mode, you can directly connect to backend data shards without the need to use proxy servers to reduce network overheads and service response time. The following sections describe the architecture and components in direct connect mode.

Figure 2. Architecture of an ApsaraDB for Redis cluster instance in direct connect mode
Architecture of an ApsaraDB for Redis cluster instance in direct connect mode

To use the direct connect mode, you must Enable a private endpoint to obtain a connection string. Then, you can connect to the cluster the same way you connect to a native Redis cluster. When a client connects to the cluster for the first time, DNS resolves the connection string to the virtual IP address of a random shard. Then, the client can use the Redis cluster protocol to access each data shard. The direct connect mode and proxy mode are quite different from each other. For more information about relevant precautions and connection examples, see Use a private endpoint to connect to an ApsaraDB for Redis instance.

Scenarios

  • Large data volume

    Cluster instances of ApsaraDB for Redis support the scaling of storage capacity. Compared with standard instances, cluster instances support a storage capacity of up to 4,098 GB. You can scale out storage capacity as needed.

  • High QPS

    A standard instance of ApsaraDB for Redis cannot support high-QPS scenarios. You must deploy multiple data shards to resolve the performance bottleneck caused by the single-threading model. Cluster instances of ApsaraDB for Redis support a variety of storage specifications, such as 16 GB, 32 GB, 64 GB, 128 GB, and 256 GB, and can be deployed with either 8 or 16 nodes. Compared with standard instances, cluster instances improve the QPS performance by 8 or 16 times.

  • Throughput-intensive applications

    Compared with standard instances, cluster instances provide higher throughput over internal networks. You can read hot data with high performance and manage high-throughput workloads.

  • Applications that do not require high compatibility with the Redis protocol

    A cluster instance has multiple components. Therefore, compared with a standard instance, a cluster instance has more limits when it runs Redis commands. For more information, see Limits on the commands supported by cluster instances.

References

FAQ

Q: Can I use the direct connect mode and proxy mode simultaneously?

A: Yes.