All Products
Document Center

ApsaraDB for Redis:Extended data structures of ApsaraDB for Redis Enhanced Edition (Tair)

Last Updated:Aug 02, 2023

This topic describes the data structures that are integrated into ApsaraDB for Redis Enhanced Edition (Tair) and compares the features of Tair and Redis Stack.

Similar to open source Redis, ApsaraDB for Redis Community Edition supports a variety of data structures such as STRING, LIST, HASH, SET, SORTED SET, and STREAM. These data structures are sufficient for most development workloads but not for complex workloads. To manage complex workloads, you must write numerous lines of code or run Lua scripts.

Tair instances integrate multiple in-house data structures, including exString (including commands that enhance Redis string functionality), exHash, GIS, Bloom, Doc, TS, Cpc, exZset, Roaring, Vector, and Search. These data structures allow Tair to support multiple scenarios, make application development easier, and simplify business code. This improves performance and helps you focus on business innovation.


Extended data structures of Tair and modules of Redis Stack



Redis Stack




  • TairString is a STRING-type data structure that contains a version number. Moreover, TairString 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.

Best practices: Implement high-performance optimistic locking by using TairString and Implement bounded counters by using TairString.




TairHash is a data structure 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.

Best practices: Manage multi-device logon from a single user by using TairHash




TairZset allows DOUBLE-typed scores to be sorted with respect to 256 dimensions. You can use TairZset to implement regular leaderboards and distributed leaderboards to detect malware. If malware is detected, the feature generates alert events. The data structure is open-sourced. For more information, see TairZset.

Best practices: Implement multidimensional leaderboards by using TairZset and Implement distributed leaderboards by using TairZset.




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

Best practices: Implement digital fences by using TairGIS and Implement local purchase services by using TairGIS.

Doc (JSON)



Similar to RedisJSON, TairDoc is a data structure that supports JSON standards and stores data of the document type. TairDoc data is stored as binary trees to allow quick access to child elements of JSON objects.




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




Compared with RedisTimeSeries, TairTS extends the capability of tags. In the TairTS data structure, 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.

Best practices: Implement fine-grained monitoring by using TairTS




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, see Bloom.



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 tumbling 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.




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

Best practices: Select users by using TairRoaring



Redis Search (Vector Similarity)

TairVector is a self-developed data structure that provides high-performance real-time storage and retrieval of vectors.

Best practices: Implement multi-modal (image-text) query by using TairVector and Implement approximate query for molecular geometries by using TairVector.