All Products
Search
Document Center

Tair (Redis® OSS-Compatible):Extended data structures of Tair

Last Updated:Dec 06, 2024

Tair (Redis OSS-compatible) supports the fundamental data structures of open source Redis, 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 a substantial amount of code or use complex approaches such as Lua scripting. Tair (Enterprise Edition) integrates multiple data structures developed in-house by Alibaba Cloud, such as exString (including commands that enhance Redis string functionality), exHash, exZset, GIS, Bloom, Doc, TS, Cpc, Roaring, Search, and Vector. These data structures allow Tair (Enterprise Edition) to support more scenarios, make application development easier, and simplify business code. This improves service performance and helps you focus on business innovation.

Note

Extended data structures of Tair and modules of Redis Stack

The following table describes the data structures that are integrated into Tair and compares these data structures with Redis Stack Server modules.

Data type

Tair extended data structure

Redis Stack module

Description

String

N/A

  • exString is a String-type data structure that contains a version number. exString 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.

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

Hash

exHash

N/A

TairHash is a data structure that allows you to specify the expiration time and version number of 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

Zset

exZset

N/A

TairZset allows Double-type scores to be sorted with respect to 256 dimensions. You can use TairZset to implement general-purpose leaderboards and multidimensional leaderboards. This 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.

GeoSpatial

GIS

N/A

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. This 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)

Doc

RedisJSON

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

Search

Search

RediSearch

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

TimeSeries

TS

RedisTimeSeries

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

Sketches

Bloom

RedisBloom

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.

Best practices: TairBloom can be used for recommendation and crawler systems. For more information, see Bloom and Use Bloom filters to manage game event push notifications.

Cpc

N/A

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 better facilitate data streaming. It also supports common aggregation operators used in big data analytics, such as DISTINCT, COUNT, MAX, MIN, FIRST, LAST, and SQUARED.

Bitmap

Roaring

N/A

TairRoaring is an efficient computing module that provides high stability. It supports operations on multiple bitmaps, which improves performance and space efficiency.

Best practices: Select users by using TairRoaring

Vector

Vector

Redis Search (Vector Similarity)

TairVector is an in-house data structure of Tair that provides high-performance real-time storage and retrieval of vectors.

Best practices:

FAQ

Does Tair (Redis OSS-compatible) support Redis Stack Server?

Due to restrictions from open source licensing of Redis, Redis Open-Source Edition and Tair (Enterprise Edition) do not support Redis Stack Server.

To work around this limitation, Tair (Enterprise Edition) provides self-developed extended data structures, including exString (including commands that enhance Redis string functionality), exHash, exZset, GIS, Bloom, Doc, TS, Cpc, Roaring, Search, and Vector. Compared with Redis Stack Server, Tair (Enterprise Edition) supports a broader range of data structures and exhibits superior performance in specific data structures.