Cluster master-replica instances of ApsaraDB for Redis can resolve the performance bottleneck that is caused by the single-threading mode. You can use the instances to process large-capacity or high-performance workloads. Cluster master-replica instances can run in proxy mode or direct connection mode. You can select one mode based on your business requirements.
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 name). Requests from clients are forwarded to each data shard through a proxy server. To simplify application development and coding, proxy servers, data shards, and config servers do not provide separate endpoints. The following sections describe the architecture and components in proxy mode.
|Proxy server||Each proxy server has a single node configured. 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 number and configurations of instance components depend on the specifications that you select when you create a cluster instance. You can use Change specifications 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 deteriorates the service response time, because all requests are forwarded by proxy servers. If you require high response speed, use the direct connection mode. In this mode, you can directly connect to backend data shards without the need to use proxy servers. This reduces network overheads and service response time. The following sections describe the architecture and components in direct connection mode.
To use the direct connection mode, you must first apply for a private endpointand obtain a connection string. Then, connect to the cluster in the same way as 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 connection mode and proxy mode are quite different from each other. For more information about the precautions and connection examples, see Use a private endpoint to connect to an ApsaraDB for Redis instance.
- Large storage capacity
Cluster instances of ApsaraDB for Redis support scaling out storage capacity. Compared with standard instances, cluster instances support a storage capacity of up to 4,098 GB. You can scale out storage capacity based on your business requirements.
- High QPS
Standard instances of ApsaraDB for Redis cannot support high QPS scenarios. You must deploy multiple data shards to resolve the performance bottleneck that is caused by the single-threading mode. For more information, see Master-replica cluster instances.
- Throughput-intensive applications
Compared with standard instances, cluster instances provide higher throughput over the internal network. You can read hot data with high performance and manage high-throughput workloads.
- Applications that do not require high compatibility with Redis protocols
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.
Can I use the direct connection mode and proxy mode together?
Yes, you can use these modes together.