Performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) are suitable for scenarios that require high concurrency, a large number of read and write operations on hot data, and higher performance than ApsaraDB for Redis Community Edition instances. Compared with ApsaraDB for Redis Community Edition instances, performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) provide more benefits, mostly including enhanced multi-threading performance and enhanced integration with multiple Redis modules.

Benefits

Category Description
Compatibility
  • Performance-enhanced instances are fully compatible with native Redis databases. To switch from native Redis databases to ApsaraDB for Redis instances, you do not need to modify the application code.
Performance
  • Performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) use the multi-threading model and provide three times the performance of ApsaraDB for Redis Community Edition instances with the same specifications. This eliminates the performance limits on high-frequency read and write requests for hot data.
  • Compared with native Redis databases, performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) can process a large number of queries per second (QPS) with higher performance at higher speeds.
  • Performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) ensure stable performance in high-concurrency scenarios and alleviate connection issues that are caused by an unexpected rise in the number of requests during peak hours.
  • Performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) run full data synchronization tasks and incremental data synchronization tasks in I/O threads to accelerate the synchronization.
Architectures
  • Performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) support three architectures: standard, cluster, and read/write splitting.
Integration with multiple Redis modules
  • Performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) are integrated with multiple Redis modules that are developed by Alibaba Cloud to expand the applicable scope of ApsaraDB for Redis. These modules include . These modules remove your worries about storage structures and timeliness and allow you to focus on your business development
Enterprise-grade features
Data security
  • Performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) support SSL encryption for enhanced data security. For more information about SSL encryption, see Configure SSL encryption for an ApsaraDB for Redis instance.
  • Performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) support Transparent Data Encryption (TDE). TDE implements real-time I/O encryption and decryption on Redis Database (RDB) files to ensure data security. For more information about TDE, Enable TDE.

Scenarios

Performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) can be used in scenarios such as live video streaming, flash sales, and online education. The following section describes typical scenarios:

  • Scenario 1: During flash sales of popular commodities, the number of QPS on cached hotkeys may exceed 200,000 during peak hours. Standard master-replica instances of ApsaraDB for Redis Community Edition cannot meet this requirement.

    Performance-enhanced standard instances of ApsaraDB for Redis Enhanced Edition (Tair) can efficiently process requests during these flash sales without performance issues.

  • Scenario 2: Cluster instances of ApsaraDB for Redis Community Edition have limits on database transactions and Lua scripts.

    Performance-enhanced cluster instances of ApsaraDB for Redis Enhanced Edition (Tair) provide high performance and eliminate the limits on the usage of commands in cluster instances of ApsaraDB for Redis Community Edition.

  • Scenario 3: You have created a self-managed Redis instance that consists of one master node and multiple replica nodes. The number of replica nodes and O&M costs increase as your workloads increase.

    Performance-enhanced read/write splitting instances of ApsaraDB for Redis Enhanced Edition (Tair) can provide one data node and up to five read replicas. This architecture allows you to deliver millions of QPS.

  • Scenario 4: You have created a self-managed Redis cluster to deliver tens of millions of QPS. The number of data shards and O&M costs increase as your workloads increase.

    Performance-enhanced cluster instances of ApsaraDB for Redis Enhanced Edition (Tair) can reduce the cluster size by two thirds to significantly reduce the O&M costs.

Comparison between threading models

Threading model Description
Figure 1. Single-threading model
Single-threading model for standard instances
During request handling, native Redis databases and ApsaraDB for Redis Community Edition instances must undergo the following steps: read requests, parse requests, process data, and then send responses. In this situation, network I/O operations and request parsing consume most of the available resources.
Figure 2. Multi-threading model
Multi-threading model for performance-enhanced instances

To improve performance, each performance-enhanced instance runs multiple threads to process the tasks in these steps in parallel.

  • I/O threads are used to read requests, send responses, and parse commands.
  • Worker threads are used to process commands and timer events.
  • Auxiliary threads are used to monitor the heartbeat and status of nodes to ensure high availability.

Each performance-enhanced instance reads and parses requests in I/O threads, places the parsed requests as commands in a queue, and then sends these commands to the worker threads. Then, the worker threads run the commands to process the requests and send the responses to I/O threads by using a different queue.

Each performance-enhanced instance supports a maximum of four parallel I/O threads. Unlocked queues and pipelines are used to transmit data between I/O threads and worker threads to improve multi-threading performance.

Note
  • The processing speeds of threads are accelerated for common data structures, such as string, list, set, hash, ZSET, hyperloglog, geo, and extension structures.
  • API operations such as pub, sub, and blocking are replicated in worker threads. Therefore, these API operations can be accelerated to increase throughput and to increase performance by about 50%.
  • Transactions and Lua scripts must be executed in sequence. No acceleration can be achieved.
Note The multi-threading model of Redis 6.0 consumes large amounts of CPU resources to deliver performance that is up to two times higher than that delivered by the single-threading model of native Redis databases earlier than Redis 6.0. The Real Multi-I/O model of performance-enhanced instances offers a linear increase in throughput, and provides fully accelerated I/O threads to sustain a large number of concurrent connections.

Performance comparison

ApsaraDB for Redis Community Edition instances and native Redis databases adopt the single-threading model. In the single-threading model, each data node supports 80,000 to 100,000 QPS. Performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) adopt the multi-threading model. The multi-threading model allows the I/O, worker, and auxiliary threads to process requests in parallel. Each data node of a performance-enhanced instance delivers performance that is about three times that delivered by each data node of an ApsaraDB for Redis Community Edition instance. The following table describes the scenarios of ApsaraDB for Redis Community Edition instances and performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) in different architectures.

Architecture Instance edition Description
Standard ApsaraDB for Redis Community Edition instances These instances are not suitable if the number of QPS that is required on a single instance exceeds 100,000.
Performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) These instances are suitable if the number of QPS that is required on a single instance exceeds 100,000.
Cluster ApsaraDB for Redis Community Edition instances A cluster instance consists of multiple data nodes. Each data node provides performance that is comparable to the performance of a standard instance. If a data node stores hot data and receives a large number of concurrent requests to query the hot data, the read and write operations on the other data that is stored on the data node may be affected. As a result, the performance of the data node deteriorates.
Performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) These instances provide high performance to read and write hot data at reduced maintenance costs.
Read /write splitting ApsaraDB for Redis Community Edition instances These instances provide high read performance and are suitable for scenarios in which the number of read operations is larger than the number of write operations. However, these instances cannot support a large number of concurrent write operations.
Performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) These instances provide high read performance and can support a large number of concurrent write operations. These instances are suitable for scenarios in which a large number of write operations need to be processed but the number of read operations is larger than the number of write operations.

Integration with multiple Redis modules

Similar to open source Redis, ApsaraDB for Redis Community Edition supports various native data types, such as strings, lists, hashes, sets, sorted sets, and streams. These data types support common development workloads, but do not support complex workloads. To manage complex workloads, you must make required adjustments. For example, you must modify your application data or run Lua scripts.

Performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) are integrated with multiple Redis modules to expand the applicable scope of ApsaraDB for Redis. These modules include . These modules simplify business development in complex scenarios and allow you to focus on your business innovation.

Table 1. New command types supported
Command type Description
CAS and CAD commands These commands are developed to enhance the performance of Redis strings. You can use them to implement simple and efficient distributed locks based on Redis. For more information, see Implement high-performance distributed locks by using TairString.
TairString commands A TairString is a string that contains a key, a value, and a version number. The INCRBY and INCRBYFLOAT commands are used to increase or decrease the values of Redis strings. You can use TairStrings to limit the range of results returned by these commands. If a result is out of range, an error message is returned
TairHash commands A TairHash is a hash that supports multiple commands and provides the same high performance as a native Redis hash. In addition, TairHashes allow you to specify the expiration time and version number of a field. This helps you simplify the development process. TairHashes use the efficient active expire algorithm to check the expiration time of fields and delete expired fields. This process does not increase the database response time.
TairGIS commands A TairGIS is a data structure that uses R-tree indexes and supports geographic information system (GIS) API operations. Native Redis GEO commands allow you to use one-dimensional indexes to query points. TairGIS commands allow you to query points, lines, and planes by using two-dimensional indexes. You can also use TairGIS commands to check the relationships between different elements, such as whether A contains B or A intersects with B.
TairBloom commands A TairBloom is a Bloom filter that supports dynamic scaling and is fully compatible with RedisBloom commands. Compared with traditional methods that achieve a similar feature, TairBlooms consume less memory and maintain a stable false positive rate during scaling. You can use TairBlooms to check whether a large amount of data exists. In this case, a specific false positive rate is allowed.
TairDoc commands A TairDoc is a document data structure. It supports JSON standards and is fully compatible with RedisJSON commands. TairDoc data is stored in binary trees and allows fast access to child elements.
TairZset commands Native Redis Sorted Sets (ZSETs) allow you to sort elements based on score data of the DOUBLE type only in one dimension. To exceed the limit, Alibaba Cloud has developed the TairZset data structure that allows you to sort elements based on score data of the DOUBLE type from different dimensions. This data structure improves the efficiency of data processing and is also easy to use on the client side because you do not need to encode, decode, or encapsulate the data.
TairRoaring commands

The TairRoaring data structure is developed on top of Roaring bitmaps of Tair. TairRoaring uses two-level indexes and introduces multiple dynamic containers. TairRoaring also adopts optimization methods such as single instruction, multiple data (SIMD), vectorization, and popcount to provide less memory consumption and deliver higher computing efficiency for collections.

Enterprise-grade features

Enterprise-grade features Description
Use data flashback to restore data by point in time After you enable the data flashback feature, ApsaraDB for Redis retains append-only file (AOF) backup data for up to seven days. During the retention period, you can specify a point in time that is accurate to the second to create an instance and restores the backup data at the specified point in time to the new instance.
Proxy query cache After you enable the proxy query cache feature, the configured proxy nodes cache the requests and responses for hotkeys. If the same requests are received from a client within the specified validity period, ApsaraDB for Redis retrieves the responses to the requests from the cache and returns the responses to the client. During this process, ApsaraDB for Redis does not need to interact with the data shards that reside in the backend. For more information, see Use proxy query cache to address issues caused by hotkeys.
Global Distributed Cache for Redis Global Distributed Cache for Redis is a geo-redundancy database system that is developed by Alibaba Cloud based on ApsaraDB for Redis. Global Distributed Cache for Redis helps enterprises provide database services from multiple data centers that are deployed in different locations by replicating the active geo-redundancy architecture of Alibaba Cloud.
Two-way data synchronization by using DTS Data Transmission Service (DTS) supports two-way data synchronization between instances of ApsaraDB for Redis Enhanced Edition (Tair). For more information about DTS, see What is DTS? This synchronization solution is suitable for scenarios such as active geo-redundancy and geo-disaster recovery. For more information, see Configure two-way data synchronization between ApsaraDB for Redis Enhanced Edition (Tair) instances.

FAQ

Q: What do I do if a client does not support the commands that are provided by new modules?

A: Two methods are available for you. The first method is to define the commands that are provided by new modules in your application code before you use these commands in your client. The second method is to use the TairJedis client that is developed by Alibaba Cloud based on Jedis.