Like open-source Redis, Tair (Redis OSS-compatible) supports standard data types such as String, List, Hash, Set, Sorted Set, and Stream. While sufficient for many use cases, these types can fall short in complex business scenarios that require extensive custom code or complex Lua scripts. To address this, Tair (Enterprise Edition) integrates a suite of proprietary data structures. These include exString (which includes Redis String command enhancement), exHash, exZset, GIS, TairBloom, Doc, TS, Cpc, Roaring, TairSearch, and Vector. They expand the capabilities of Redis, reduce development complexity for advanced applications, streamline your code, and improve overall business performance, allowing you to focus on innovation.
-
DRAM-based instances that are compatible with Redis 7.0 or 6.0 support all the preceding data structures.
-
DRAM-based instances that are compatible with Redis 5.0 support all the preceding data structures other than TairVector.
-
Persistent memory-optimized instances are compatible with exString (including commands that enhance Redis string functionality), exHash, and Cpc.
Tair extended data structures and Redis Stack modules
The following table describes the data structures integrated into Tair and compares their features with those of Redis Stack Server.
|
Type |
Tair extended data structure |
Description |
|
|
String enhancement |
None |
Best practices: Implement high-performance optimistic locking by using TairString and Implement an efficient rate limiter by using TairString. |
|
|
Hash enhancement |
None |
exHash allows you to set a time-to-live (TTL) and a version for individual fields within a hash. This enhances the flexibility of the Hash data structure and simplifies development for many use cases. This data structure is open source. For more information, see TairHash. Best practice: Manage multi-device user logon by using TairHash. |
|
|
Zset enhancement |
None |
exZset supports sorting scores of type double across 256 dimensions, enabling both standard and multi-dimensional leaderboards. This data structure is open source. For more information, see TairZset. Best practices: Easily implement multi-dimensional leaderboards by using exZset and Implement distributed leaderboards by using exZset. |
|
|
Geospatial |
None |
TairGIS is a data structure that uses an R-tree for indexing and supports APIs for geographic information systems (GIS). It supports queries for points, linestrings, and polygons, and relationship checks such as contains, within, and intersects. This data structure is open source. For more information, see TairGIS. Best practices: Implement geofencing by using TairGIS and Implement a local shopping service by using TairGIS. |
|
|
Doc (JSON) |
RedisJSON |
TairDoc is a document-type data structure that supports the JSON standard, similar to the RedisJSON module. TairDoc stores data in a binary tree format, which allows for fast access to sub-elements within a JSON object. |
|
|
Search |
RediSearch |
TairSearch provides an Elasticsearch-like (ES-like) query syntax, a wider range of accurate tokenizers, and superior query performance. |
|
|
Time series |
RedisTimeSeries |
Compared to RedisTimeSeries, TairTS offers greater tag scalability. It supports a two-level hash structure for timelines based on skeys (tags), enables aggregate queries on the secondary timeline, and allows you to update or append data to historical time series. Best practice: Implement second-level monitoring by using TairTS. |
|
|
Sketches |
RedisBloom |
TairBloom is compatible with RedisBloom and supports dynamic scaling. It uses a 64-bit hash algorithm to reduce hash collisions, significantly lowering the collision rate for large datasets. Best practices: Ideal for recommendation systems and crawler systems. For more information, see TairBloom and Efficiently manage game event push notifications by using a Bloom filter. |
|
|
None |
TairCpc is a data structure developed based on the Compressed Probability Counting (CPC) sketch algorithm. It performs high-performance calculations on sampled data while using minimal memory. TairCpc supports both tumbling and sliding windows for better stream processing and includes common aggregation operators used in big data analytics, such as |
||
|
Bitmap |
None |
TairRoaring provides an efficient and highly stable computing module. It supports operations on multiple bitmaps, which improves performance and space efficiency. Best practice: Implement user cohort selection by using TairRoaring. |
|
|
vector search |
Redis Search (Vector Similarity) |
TairVector is a proprietary extended data structure developed by Tair. It provides a high-performance, real-time vector database service that integrates storage and retrieval. Best practices: |
Tair (Enterprise Edition) clients
To simplify using Tair extended data structures, Tair has developed Tair clients based on several popular Redis clients. You can use these Tair clients to directly access Tair extended data structures.
You can find the following clients on GitHub. The repositories also include example code.
|
Tair client |
Programming language |
Description |
|
Java |
A Tair client built on Jedis. |
|
|
.NET |
A Tair client built on .NET Core 5.0 and StackExchange.Redis 2.5.61. |
|
|
Go |
A Tair client built on go-redis. |
|
|
Python |
A Tair client built on redis-py. |
FAQ
-
Q: Does Tair (Redis OSS-compatible) support Redis Stack Server?
A: Due to Redis's open source license restrictions, neither Alibaba Cloud's Redis Open-Source Edition nor Tair (Enterprise Edition) supports Redis Stack Server.
To address this, Tair (Enterprise Edition) provides its own proprietary extended data structures, including exString (which includes Redis String command enhancement), exHash, exZset, GIS, TairBloom, Doc, TS, Cpc, Roaring, TairSearch, and Vector. Tair supports a wider range of data structures than Redis Stack Server and offers better performance for some of them.
-
Q: How do I set a time-to-live (TTL) for Tair extended data structures?
A: For exString, exHash, and Cpc, you can set the TTL directly with their specific commands. For other Tair extended data structures, set the key's TTL with the
EXPIRE | EXPIREAT <Keyname>command, such asEXPIRE foo 60. -
Q: How can I check which extended data structures my instance supports?
A: The supported extended data structures depend on the instance edition and type. Log on to the Tair console and go to the Instance Details page to check your instance's edition (Redis Open-Source Edition or Tair (Enterprise Edition)) and type. Then, refer to the following list to determine which structures are supported:
-
Redis Open-Source Edition: Supports only standard Redis commands and does not support Tair extended data structures.
-
in-memory type: Support varies by the Redis compatibility version. Instances compatible with Redis 7.0 and 6.0 support all Tair extended data structures, while instances compatible with Redis 5.0 do not support Vector.
-
persistent memory type: Supports only exString (including Redis String command enhancement), exHash, and Cpc.
-
disk-based type: Does not support Tair extended data structures.
-