Tair DRAM-based instances are suitable for scenarios that involve 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, DRAM-based instances provide more benefits, including enhanced multi-threading performance and integration with multiple extended data structures.
Benefits
Item | Description |
---|---|
Compatibility |
|
Performance |
|
Architecture |
|
Integration of multiple data structure modules |
|
Enterprise-grade feature |
|
Data security |
|
Scenarios
- Scenario 1: During flash sales, the number of QPS on some cached hotkeys may exceed
200,000. ApsaraDB for Redis Community Edition instances cannot meet this requirement.
Tair DRAM-based instances can efficiently process requests during these flash sales without performance issues.
- Scenario 2: Cluster instances of the ApsaraDB for Redis Community Edition have limits
on database transactions and Lua scripts.
Tair DRAM-based instances provide high performance and eliminate the limits on the usage of commands in cluster instances of the 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.
Tair DRAM-based instances that use the read/write splitting architecture can provide one data node and up to five read replicas to help you handle millions of QPS.
- Scenario 4: You have created a self-managed Redis cluster to handle tens of millions
of QPS. The number of data shards and O&M costs increase as your workloads increase.
Tair DRAM-based instances can downsize clusters by two thirds and significantly reduce O&M costs.
Comparison between threading models
Threading model | Description |
---|---|
![]() |
ApsaraDB for Redis Community Edition instances and native Redis databases adopt the single-threading model. 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 available resources. |
![]() |
To improve performance, each Tair DRAM-based instance runs on multiple threads to process the tasks in these steps in parallel.
Each DRAM-based instance reads and parses requests in I/O threads, places the parsed requests as commands in a queue, and then sends these commands to 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. A Tair DRAM-based instance can process up to four I/O threads in concurrency. Unlocked queues and pipelines are used to transmit data between I/O threads and worker threads to improve multi-threading performance. Note
|
Performance comparison
Architecture | ApsaraDB for Redis | Tair DRAM-based instance |
---|---|---|
Standard architecture | These instances are not suitable if the number of QPS that is required on a single node exceeds 100,000. | These instances are suitable if the number of QPS that is required on a single node exceeds 100,000. |
Cluster architecture | A cluster instance consists of multiple data nodes. Each data node provides performance that is similar to that of a standard instance. If a data node stores hot data and receives a large number of concurrent requests for hot data, the read and write operations on other data that is stored on the data node may be affected. As a result, the performance of the data node deteriorates. | These instances provide high performance to read and write hot data at reduced maintenance costs. |
Read /write splitting | 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. | 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 of multiple Redis modules
Similar to open source Redis, ApsaraDB for Redis Community Edition supports a variety of data structures such as strings, lists, hashes, sets, sorted sets, and streams. These data structures are sufficient to support common development workloads but not sophisticated workloads. To manage sophisticated workloads, you must modify your application data or run Lua scripts.
DRAM-based instances of the ApsaraDB for Redis Enhanced Edition (Tair) are integrated with multiple Redis modules to expand the applicable scope of ApsaraDB for Redis. These modules include TairString (including CAS and CAD commands), TairHash, TairGIS, TairBloom, TairDoc, TairTS, TairCpc, TairZset, TairRoaring, TairVector, and TairSearch. These modules simplify business development in complex scenarios and allow you to focus on your business innovation.
- DRAM-based instances that are compatible with Redis 6.0 support all data structures other than TairSearch.
- DRAM-based instances that are compatible with Redis 5.0 support all data structures other than TairVector.
Data structure | Description |
---|---|
CAS and CAD commands | These commands are developed to enhance the functionality of Redis strings. You can use the commands to implement simple and efficient distributed locks based on Redis. For more information, see Implement high-performance distributed locks by using TairString. |
TairString | TairString is a string-type data structure that consists of a key, a value, and a version number. Moreover, TairSting can be used to limit the range of outputs returned by the INCRBY and INCRBYFLOAT commands. These commands are used to increase or decrease the values of Redis strings. If outputs are out of range, error messages are returned by these commands. |
TairHash | Similar to a native Redis hash, TairHash is a hash-type module that supports a variety of data structures and provides high processing performance. To simplify the development process, TairHash also allows you to specify the expiration time and version number for a field. TairHash uses the efficient active expiration algorithm to check the expiration time of fields and delete expired fields. This process does not increase the database response time. |
TairGIS | TairGIS is a data structure that uses R-tree indexes and supports APIs related to a geographic information system (GIS). Native Redis GEO commands allow you to use one-dimensional indexes to query points. TairGIS commands allow you to use two-dimensional indexes to query points, linestrings, and polygons. 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 | 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, TairBloom consumes less memory and maintain a stable false positive rate during scaling. You can use TairBloom to check whether a large amount of data exists. In this case, a specific false positive rate is allowed. |
TairDoc | 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. |
TairTS | TairTS is a time series data structure that is developed on top of Redis modules. This data structure provides low-latency and high-concurrency in-memory read and write access, supports fast filtering and aggregate queries, and has both storage and computing power. TairTS simplifies the processing of time series data and significantly improves performance. |
TairCpc |
TairCpc is a data structure developed based on the compressed probability counting (CPC) sketch. It allows you to perform high-performance computing on sampled data while using only a small amount of memory. |
TairZset | 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 with respect to different dimensions. This data structure improves the efficiency of data processing and is also easy to use on the client side without the need to encode, decode, or encapsulate the data. |
TairRoaring |
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. |
TairSearch |
TairSearch is a full-text search module developed in-house based on Redis modules instead of open source search engine software libraries such as Lucene. TairSearch uses query syntax that is similar to that of Elasticsearch. |
TairVector | TairVector is a self-developed data structure that provides high-performance real-time storage and retrieval of vectors. |
Enterprise-grade features
Enterprise-grade feature | 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 restore 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 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 backend data shards. For more information, see Use proxy query cache to address issues caused by hotkeys. |
Global distributed cache | Global Distributed Cache for Redis is an active geo-redundancy database system that is developed based on ApsaraDB for Redis. Global Distributed Cache for Redis supports business scenarios in which multiple sites in different regions provide services at the same time. It helps enterprises replicate the active geo-redundancy architecture of Alibaba. |
Two-way data synchronization by using DTS | Data Transmission Service (DTS) supports two-way data synchronization between instances of the 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 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 data structures?
A: You can define the commands that are provided by new data structures in your application code before you use the commands in your client. Alternatively, you can use Tair clients to invoke these data structures. For more information, see and .