All Products
Search
Document Center

Tair:DRAM-based instances

Last Updated:Sep 21, 2023

Tair DRAM-based instances are suitable for scenarios that require high concurrency and involve large amounts of hot data. DRAM-based instances have multi-threading performance enhanced and a broad set of in-house enhanced data structures integrated.

Purchase methods

Create a Tair instance

Benefits

Item

Description

Compatibility

  • Fully compatible with native Redis databases. To switch from native Redis databases to Tair instances, you do not need to modify the application code.

Performance

  • Uses the multi-threading model and provides 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, Tair DRAM-based instances can process a large number of queries per second (QPS) with higher performance at higher speeds.

  • Ensures stable performance in high-concurrency scenarios and alleviates connection issues that are caused by traffic spikes during peak hours.

  • Runs full and incremental data synchronization tasks in I/O threads to accelerate synchronizations.

Architecture

  • Supports the standard, cluster, and read/write splitting architectures.

Integration of multiple data modules

Enterprise-grade feature

Data security

  • Supports SSL encryption for enhanced data security. For more information about SSL encryption, see Configure SSL encryption.

  • Supports Redis Database (RDB) file encryption and decryption by using Transparent Data Encryption (TDE) for enhanced data security. For more information, see Enable TDE.

Scenarios

Tair DRAM-based instances 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, 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: ApsaraDB for Redis Community Edition cluster instances 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 ApsaraDB for Redis Community Edition cluster instances.

  • 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

Figure 1. Single-threading modelSingle-threading model for standard instances

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.

Figure 2. Multi-threading modelMulti-threading model for performance-enhanced instances

To improve performance, each Tair DRAM-based instance runs on 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 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
  • The processing speeds of threads are accelerated for common data structures, such as strings, lists, sets, hashes, zsets, HyperLogLog, Geo, and extended 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 twice higher than that delivered by the single-threading model of a major version earlier than Redis 6.0. The Real Multi-I/O model of DRAM-based instances provides fully accelerated I/O threads to sustain a large number of concurrent connections and offer a linear increase in throughput.

Performance comparison

ApsaraDB for Redis 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. Tair DRAM-based instances 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 DRAM-based 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 ApsaraDB for Redis and Tair DRAM-based instances of different architectures and their use cases.

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 data modules

Multiple data modules are integrated into Tair DRAM-based instances. This allows DRAM-based instances to support more scenarios. These modules include exString (including Commands that enhance Redis string functionality), exHash, GIS, Bloom, Doc, TS, Cpc, exZset, and Search. These modules simplify business development in complex scenarios and allow you to focus on your business innovation.

Note
  • DRAM-based instances are compatible with Redis 6.0 and the preceding data structures other than TairSearch.
  • DRAM-based instances are compatible with Redis 5.0 and the preceding data structures other than TairVector.
TypeExtended data structure of TairRedis Stack ServerDescription
StringNone
  • A TairString is a string that contains a version number. Moreover, TairStings 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 an output falls out of the specified range, error messages are returned by these commands. This data structure is open-sourced. For more information, see TairString.
  • TairString commands include CAS and CAD commands. CAS and CAD commands can be used to implement simple and efficient Redis distributed locking. For more information about Redis distributed locking, see Implement high-performance distributed locks by using TairString.

For information about the best practices, see Implement high-performance optimistic locking by using TairString and Implement bounded counters by using TairString.

HashexHashNone

A TairHash is a hash that allows you to specify the expiration time and version number for a field. TairHash is more flexible in use and simplifies application development in most scenarios. This data structure is open-sourced. For more information, see TairHash.

ZsetexZsetNone
TairZset allows DOUBLE-typed scores to be sorted with respect to 256 dimensions. You can use TairZset to implement regular leaderboards and distributed leaderboards. The data structure is open-sourced. For more information, see TairZset.

For information about the best practices, see Implement multidimensional leaderboards by using TairZset and Implement distributed leaderboards by using TairZset.

Doc (JSON)DocRedisJSON

TairDoc is compatible with RedisJSON, supports JSONPath and JSON Pointer syntax, and allows conversion from the JSON format to the XML or YAML format.

SearchSearchRedisSearch

TairSearch uses syntax similar to that of Elasticsearch but provides more and better tokenizers to improve query performance.

For information about the best practices, see Accelerate queries with multi-column indexes by using TairSearch.

GeoSpatialGISNone

A TairGIS is a data structure that uses R-tree indexes and supports APIs related to a geographic information system (GIS). TairGIS allows points, linestrings, and polygons to be queried. You can use TairGIS to check whether A contains B, whether A is contained by B, or whether A intersects with B.

For information about the best practices, see Implement digital fences by using TairGIS.

TimeSeriesTSRedisTimeSeries

Compared with RedisTimeSeries, TairTS extends the capability of tags. In TairTS, an extra hash layer is added to support your aggregate queries on timelines. You can also use TairTS to update or add data to historical time series data.

For information about the best practices, see Implement fine-grained monitoring by using TairTS.

SketchesBloomRedisBloom

TairBloom is compatible with RedisBloom, supports dynamic scaling, and provides 64-bit hash algorithms to significantly reduce the probability of collision for large amounts of data.

The best practices of TairBloom include the implementation of recommendation and crawler systems. For more information about the best practices, see Bloom.

CpcNone

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 with a small amount of memory. TairCpc supports rolling and sliding windows to implement data streaming and common aggregation operators in big data analytics such as DISTINCT, COUNT, MAX, MIN, FIRST, LAST, and SQUARED.

BitmapTairRoaringNone

TairRoaring is an efficient computing module and provides high stability to support multi-bit computing power and improve performance and space complexity.

For information about the best practices, see Select users by using TairRoaring.

VectorVectorRedisSearch (vector similarity)

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 of Tair, Tair 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.

Use proxy query cache to address issues caused by hotkeys

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, Tair retrieves the responses to the requests from the cache and returns the responses to the client. During this process, Tair does not need to interact with backend data shards.

Global Distributed Cache

Global Distributed Cache for Tair is an active geo-redundancy database system that is developed based on ApsaraDB for Redis. Global Distributed Cache 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 between Tair instances

Data Transmission Service (DTS) supports two-way data synchronization between Tair instances. 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.

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 Overview and Extended data structures of ApsaraDB for Redis Enhanced Edition (Tair).