When you create an ApsaraDB for Redis instance, you must select the most cost-effective and stable instance type that can suit your performance, price, scenario, and workload needs. This topic describes the instance types, editions, architectures, and storage media of ApsaraDB for Redis to help you select instances.

Overview of ApsaraDB for Redis

ApsaraDB for Redis is a database service that is compatible with open source Redis protocols and supports a variety of storage media. ApsaraDB for Redis provides the hot standby architecture and the cluster architecture, and can scale to meet requirements for high-throughput and low-latency operations.

Figure 1. Overview of ApsaraDB for Redis
Overview of ApsaraDB for Redis

Selection procedure

When you create an ApsaraDB for Redis instance, you must select the instance type and specifications that can suit your performance, price, scenario, and workload needs.For example, you need to select different instance types and specifications based on whether you use the instance as a high-speed cache or anin-memory database.The following table describes the recommended procedure for selecting ApsaraDB for Redis instances.

Note For more information about the pricing of ApsaraDB for Redis, see Billable items and prices.
Step Description
Select ApsaraDB for Redis Community Edition or Enhanced Edition (Tair) ApsaraDB for Redis provides Community Edition and Enhanced Edition (Tair). ApsaraDB for Redis Enhanced Edition (Tair) is developed based on Tair, which is an internal service that is used inside Alibaba Cloud. ApsaraDB for Redis Enhanced Edition (Tair) provides higher performance, more data structures, and more flexible storage methods.
Select a deployment architecture ApsaraDB for Redis provides instances that use the standard architecture, cluster architecture, or read/write splitting architecture. You can select an architecture that suits your business data volume and your requirements for read and write capabilities and business performance.
Select a disaster recovery solution If an ApsaraDB for Redis instance fails due to unexpected causes, such as device failures and data center power failures, the disaster recovery feature ensures data consistency and service availability. ApsaraDB for Redis provides a variety of disaster recovery solutions to meet different business scenarios.
Select a major version We recommend that you use the latest major version to obtain more features.
Estimate the memory size Estimate the size of memory to be consumed. This saves costs and prevents your business from being affected by frequent specification changes.
Create an ApsaraDB for Redis instance After you determine the instance type and specifications, create an ApsaraDB for Redis instance by using the console or API of ApsaraDB for Redis.
Verify and adjust the selected instance After you create and start to use an ApsaraDB for Redis instance, we recommend that you monitor the performance of the instance when your business is running as expected. This allows you to check whether the type and specifications of the instance are suitable.

Select ApsaraDB for Redis Community Edition or Enhanced Edition (Tair)

ApsaraDB for Redis provides Community Edition and Enhanced Edition (Tair). ApsaraDB for Redis Enhanced Edition (Tair) is developed based on Tair, an internal service of Alibaba Cloud, and applies to enterprise-grade cache business. ApsaraDB for Redis Enhanced Edition (Tair) provides various series of instances based on storage media such as DRAM, NVM, and ESSDs to meet your requirements for low-latency access, persistence, and reduced overall costs. ApsaraDB for Redis Enhanced Edition (Tair) provides you with higher performance, more data structures, and more flexible storage methods. This helps you meet business requirements in different scenarios.

Notice
  • ApsaraDB for Redis Enhanced Edition (Tair) has all features of Community Edition. In addition, ApsaraDB for Redis Enhanced Edition (Tair) provides advanced features such as data flashback, proxy query cache, and global distributed cache. For more information about the comparison between Communication Edition and Enhanced Edition (Tair), see Features.
  • For more information about the commands and parameters that are supported by Community Edition and Enhanced Edition (Tair), see Overview and Parameter overview.
Edition Series type Feature Scenario
ApsaraDB for Redis Enhanced Edition (Tair) Performance-enhanced instances
  • Provides high performance. Performance-enhanced instances use the multi-threading model and provide read and write performance three times that of native Redis databases or ApsaraDB for Redis Community Edition instances of the same specifications.
  • Supports multiple Redis modules that are developed by Alibaba Cloud. These modules include TairString, TairHash, TairGIS, TairBloom, and TairDoc. This provides various solutions, simplifies development in complex scenarios, and allows you to focus on business innovations.
  • Provides high compatibility. Performance-enhanced instances are compatible with native Redis databases. You do not need to modify the code of your application when you use ApsaraDB for Redis.
Performance-centric business scenarios.
Persistent memory-optimized instances
  • Provides an ultra-high cost efficiency. The price of persistent memory-optimized instances is 30% lower than that of ApsaraDB for Redis Community Edition instances of with the same capacity. The performance of persistent memory-optimized instances reaches 90% of that of native Redis databases.
  • Prevents data loss when power failures occur. Persistent memory-optimized instances implement data persistence for each command. The system returns success for write operations only after data is persistently stored. You can use persistent memory-optimized instances as in-memory databases instead of caches.
  • Optimizes append-only file (AOF) rewriting performance for large-sized Redis databases. Persistent memory-optimized instances reduce the latency and jitter that are caused when Redis calls forks to rewrite the AOF.
  • Delivers high compatibility: Persistent memory-optimized instances are compatible with most data structures and commands of native Redis databases.
Data cache and storage scenarios that require high performance and high data persistence, and can bear high costs.
Storage-optimized instances
  • Saves costs. Storage-optimized instances save up to 85% of costs compared with ApsaraDB for Redis Community Edition instances.
  • Stores data in disks. Storage-optimized instances store data in ESSDs with high data reliability. The capacity of a storage-optimized instance reaches hundreds of TBs.
  • Optimizes memory usage for large-sized Redis databases. Storage-optimized instances reduce the amount of reserved memory that is required for the forks of native Redis databases.
  • Delivers high compatibility: Storage-optimized instances are compatible with most data structures and commands of native Redis databases.
Data storage scenarios that require a large capacity and low costs, involve only infrequent data access, and can bear high access latency.
ApsaraDB for Redis Community Edition N/A Compatible with open source Redis databases and provides high performance. These instances apply to small-sized applications, medium-sized applications, and applications for verification. They also apply to standard Redis usage and data migration scenarios.

Select a deployment architecture

ApsaraDB for Redis instances support three deployment architectures. You can select an architecture that suits your business data volume and your requirements for read and write capabilities and business performance.

Figure 2. Comparison among deployment architectures
Comparison among deployment architectures
Note
  • By default, cluster instances and read/write splitting instances provide proxy endpoints. Requests of clients are routed to data shards by proxy servers. Proxy servers help implement abundant features such as load balancing, read/write splitting, failover, proxy query cache, and persistent connection. Only performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) support proxy query cache. For more information, see Features of proxy servers.
  • If you use a cluster instance, you can use a direct endpoint to bypass proxy servers. This way, you can directly access backend data shards. This is similar to the connection to a native Redis cluster. Compared with the proxy mode, the direct connection mode reduces the response time of ApsaraDB for Redis because requests do not need to pass through a proxy server.
Architecture Overview Scenario
Standard Standard instances adopt a master-replica architecture. The master node serves your workloads, whereas the replica node stays in hot standby mode to ensure high availability. If the master node fails, the system switches the workloads to the replica node within 30 seconds after the failure occurs. This ensures high availability of your instance.
  • Support for more native Redis features.
  • Persistent storage in ApsaraDB for Redis instances.
  • Stable query rate on a single node of ApsaraDB for Redis.
  • Use of simple Redis commands, when only a few sorting and computing commands are required.
Cluster
  • A cluster instance contains proxy servers, data shards, and config servers. You can scale out a cluster instance by increasing the number of data shards.
  • A cluster master-replica instance contains multiple data shards. Each data shard works in a high-availability (HA) 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.
  • Large data volume.
  • High queries per second (QPS).
  • High-throughput and high-performance applications.
Read/write splitting
  • A read/write splitting instance contains proxy servers, master and replica nodes, and read replicas.
  • Read replicas support chained replication. This allows you to scale out read replicas to increase the read capacity.
  • High QPS scenarios, such as data hotspots.
  • Support for more native Redis features. You can use read/write splitting instances to overcome the limits of cluster instances.
Note Data synchronization to read replicas has a latency. Therefore, in scenarios that require high data consistency, we recommend that you use cluster instances instead of read/write splitting instances.

Select a disaster recovery solution

Figure 3. Disaster recovery solutions
Disaster recovery solutions
Disaster recovery solution Disaster recovery level Description
Single-zone high availability ★★★☆☆ The master and replica nodes are deployed on different machines in the same zone. If the master node fails, the HA system automatically performs failover to prevent service interruption caused by a single point of failure (SPOF).
Zone-disaster recovery ★★★★☆ The master and replica nodes are deployed in two different zones in the same region. If the master node failed to be connected due to force majeure events in the zone, such as power and network failures, the HA system performs a failover to ensure continuous availability of the entire instance.
Geo-disaster recovery ★★★★★ You can use a global replica instance of ApsaraDB for Redis to run multiple child instances simultaneously across regions worldwide. The child instances exchange data in real time by using synchronization channels. The channel manager monitors the health status of the child instances and handles exceptions such as failover. This solution can be used in scenarios such as geo-disaster recovery, active geo-redundancy, access to nearby applications, and load balancing. For more information, see Overview.

Select a major version

Select a major version of ApsaraDB for Redis based on your business requirements. All major versions are regularly maintained. You can use the latest major version to obtain more features. For more information, see Feature updates of ApsaraDB for Redis 5.0 and Features of ApsaraDB for Redis 4.0.

You must consider the following limits when you select a major version:

  • ApsaraDB for Redis Community Edition supports only Redis 4.0 and Redis 5.0.
  • Performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) support only Redis 5.0.
  • Persistent memory-optimized and storage-optimized instances of ApsaraDB for Redis Enhanced Edition (Tair) support only V1.0 of the self-developed engine. This engine is compatible with Redis 5.0.

Estimate the memory size

To create an ApsaraDB for Redis instance, you must estimate the size of memory to be consumed based on the following factors and select the most suitable memory specifications. This saves costs, prevents your business from being affected by frequent specification changes, and allows you to migrate business to the cloud at a faster pace.

Notice When you determine the memory size of an ApsaraDB for Redis instance, you must first consider the volume of the business data to be stored. In addition, you must consider the memory overhead required for the operations of the instance, such as the memory occupied by the process metadata and replication buffer. For self-managed Redis databases, you must consider the memory overhead caused by the memory fragments generated during Redis operations and the write-time replication of forks. If you use ApsaraDB for Redis instances, the preceding memory overhead is borne by Alibaba Cloud and is not included in the memory size of the purchased instance.
  • The data types, lengths, and quantity of keys.
    Note If a key, such as a key of the hash type, contains elements, you must consider the quantity and lengths of these elements.
  • The lengths of values.
  • The expiration time and eviction policy of keys.
  • The access models. For example, if the access model involves a large number of client connections, Lua scripts, and transactions, you must reserve memory for them.
  • Medium- and long-term business growth.

Create an ApsaraDB for Redis instance

After you determine the instance type and specifications, you can create an ApsaraDB for Redis instance by using the console or API of ApsaraDB for Redis. For more information, see the following topics:

Verify and adjust the selected instance

ApsaraDB for Redis supports abundant monitoring metrics. After you create and start to use an ApsaraDB for Redis instance, we recommend that you monitor the performance of the instance when your business is running as expected. This allows you to check whether the type and specifications of the instance are suitable. For more information, see Query monitoring data.

Note You can also use the Redis-benchmark tool to perform a performance stress test. For more information, see Performance stress test of Redis and instructions on Redis-benchmark.
For example, if the performance monitoring data of an ApsaraDB for Redis instance indicates high memory usage, you must check whether an anomaly exists. If no anomaly exists, upgrade the instance specifications. For more information, see Change the configurations of an instance. For more information about how to troubleshoot performance issues for ApsaraDB for Redis instances, see the following topics: