Compared with ApsaraDB for Redis Community Edition, performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) provide more benefits. For example, these instances provide enhanced multi-threading performance and integrate multiple Redis modules. This topic describes enhanced multi-threading performance of ApsaraDB for Redis Enhanced Edition (Tair).
- Supports full compatibility with native Redis databases. You do not need to modify application code when you manage on-premises Redis databases by using ApsaraDB for Redis.
- Provides read/write performance three times that of native Redis databases or ApsaraDB for Redis Community Edition when the same specifications are used. This eliminates the performance limits on high-frequency read/write requests for hot data.
- Requires less response time to process a large number of queries per second (QPS) when compared with native Redis databases.
- Ensures stable performance in high-concurrency scenarios and eliminates connection problems caused by a sudden rise in the number of requests during peak hours.
- Runs full and incremental synchronization tasks in input and output (I/O) threads to speed up the synchronization.
- Supports standard, cluster, and read/write splitting architectures.
How performance-enhanced instances work
In a process of handling requests, native Redis databases and ApsaraDB for Redis Community Edition must go through the following steps: read requests, parse requests, process data, and then send responses. During the process, network I/O operations and request parsing consume most resources. Performance-enhanced instances use 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 statuses of nodes and heartbeats.
The following figures show the differences between a single-threading model and a multi-threading model.
ApsaraDB for Redis reads and parses requests in I/O threads, and sends commands through the queues of the parsed requests to worker threads. Afterward, worker threads run the commands to process the requests and send the responses to I/O threads through other queues.
Performance-enhanced instances support a maximum of four parallel I/O threads. To improve the multi-threading performance, unlocked queues and pipelines are used to transmit data between I/O threads and worker threads.
ApsaraDB for Redis Community Edition and native Redis databases support the single-threading model. The query rate on each data shard reaches 80,000 QPS to 100,000 QPS. Performance-enhanced instances support the multi-threading model. In this model, I/O threads, worker threads, and auxiliary threads process requests in parallel. Each data shard of ApsaraDB for Redis Enhanced Edition (Tair) provides three times the performance of each data shard of ApsaraDB for Redis Community Edition. The performance is compared in details as follows:
- ApsaraDB for Redis Community Edition
- Standard instances of ApsaraDB for Redis Community Edition are not suitable for processing more than 100,000 QPS on a single data shard.
- A cluster instance of ApsaraDB for Redis Community Edition contains multiple data shards. Each data shard provides performance similar to that of a standard instance. If one of the data shards stores hot data and receives a large number of concurrent requests for hot data, the access to other data of this data shard may be delayed, which results in a performance bottleneck.
- Read/write splitting instances of ApsaraDB for Redis Community Edition provide high read performance. Instances of this type have outstanding performance in scenarios where more reads are requested than writes. These instances cannot support a large number of concurrent writes.
- Performance-enhanced standard instances of ApsaraDB for Redis Enhanced Edition (Tair)
- Performance-enhanced standard instances are suitable for processing more than 100,000 QPS on a single data shard.
- Performance-enhanced cluster instances can provide high performance to read and write hot data and reduce maintenance costs.
- Performance-enhanced read/write splitting instances can provide high read performance and process a large number of concurrent writes. Instances of this type are suitable for processing a large number of reads and writes, where more reads are requested than writes.
- Live video streaming
- Flash sales promotion systems
- Online education
Performance-enhanced instances can support a great number of concurrent reads and writes and process large amounts of hot data. You can use ApsaraDB for Redis Enhanced Edition (Tair) if you require higher performance than ApsaraDB for Redis Community Edition. The following section describes some typical scenarios where performance-enhanced instances are used.
- Scenario 1: A flash sales promotion system may process 200,000 QPS or higher for some cached hot keys. Standard master-replica instances of ApsaraDB for Redis Community Edition cannot provide high performance during peak hours. However, standard master-replica instances of ApsaraDB for Redis Enhanced Edition (Tair) can process requests for popular commodities and provide excellent user experience. The performance bottleneck is resolved.
- Scenario 2: Cluster instances of ApsaraDB for Redis Community Edition have limits on database transactions and Lua scripts. However, performance-enhanced cluster instances of ApsaraDB for Redis Enhanced Edition (Tair) can provide required performance and eliminate the limits on cluster commands.
- Scenario 3: If you build an on-premises Redis service with one master node and multiple replica nodes, the number of replica nodes increases when your workloads increase. This raises your management and maintenance costs. However, performance-enhanced read/write splitting instances of ApsaraDB for Redis Enhanced Edition (Tair) can provide one data shard and up to five read replicas. This architecture helps you process one million or more QPS.
- Scenario 4: If you build an on-premises Redis cluster to process ten million or more QPS, the number of shards increases when your workloads increase. This raises your management and maintenance costs. However, performance-enhanced cluster instances of ApsaraDB for Redis Enhanced Edition (Tair) can serve your workloads and reduce the cluster size by two thirds. This instance type is a cost-effective choice.
For more information about the specifications of performance-enhanced instances, see Overview.
Purchase and activate an instance
For more information, see Step 1: Create an ApsaraDB for Redis instance.