Compared with ApsaraDB for Redis Community Edition instances, performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) provide enhanced multi-threading performance and are integrated with multiple Redis modules. This topic describes the features and benefits of the Redis modules that are integrated into performance-enhanced instances.

Note For more information about enhanced multi-threading performance, see Performance-enhanced instances.

Background information

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 support common development workloads but not sophisticated workloads. To manage sophisticated workloads, you must modify your application data or run Lua scripts. Performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) are integrated with multiple Redis modules developed by Alibaba Cloud to expand the applicable scope of ApsaraDB for Redis. These modules include . These modules simplify business development in sophisticated scenarios and allow you to focus on your business innovation.

TairString

You can use the TairString module in the following ways:

  • Run the commands that are developed to enhance the performance of Redis string processing.

    These commands include Compare And Set (CAS) and Compare And Delete (CAD) commands, which enable simple and efficient Redis distributed locking. For more information about Redis distributed locking, see Implement high-performance distributed locks by using TairString. For more information about CAS and CAD commands, see CAS and CAD commands.

  • Use the TairString data structure and TairString commands.

    TairStrings are strings that include version numbers. Native Redis strings use a key-value pair structure and contain only keys and values. However, TairStrings consist of keys, values, and version numbers. Moreover, TairStings can be used to limit the range of results returned by the INCRBY and INCRBYFLOAT commands. These commands are used to increase or decrease the values of Redis strings. If a result is out of range, error messages are returned by these commands..

    For more information about TairString commands, see TairString commands.

    Note TairStrings are different from native Redis strings.

TairHash

TairHash is a new data structure module of ApsaraDB for Redis.

A TairHash is a hash. Similar to the native Redis Hash data structure, TairHash supports multiple APIs and high performance data processing. For native Redis hashes, you can specify the time-to-live (TTL) only for keys. However, TairHash allows you to specify the TTL of both keys and fields and specify versions of fields. These features help you simplify the development in most scenarios. TairHash uses an efficient active expire algorithm to check the TTL of fields and delete expired fields. This process does not increase the database response time.

For more information about TairHash commands, see TairHash commands.

Note TairHashes are different from native Redis hashes.

TairGIS

TairGIS is a new data structure module of ApsaraDB for Redis.

A TairGIS is a data structure that uses R-tree indexes and supports APIs related to a geographic information system (GIS). The Redis-native GEO commands use one-dimensional indexes and allow you to use geohashes and sorted sets to query points. Compared with GEO commands, TairGIS uses two-dimensional indexes and allows you to query points, lines, and polygons, which is especially suitable for checking the intersection or inclusion relationships.

For more information about TairGIS commands, see TairGIS commands.

TairBloom

TairBloom is a new data structure module of ApsaraDB for Redis.

TairBloom is a Bloom filter that supports dynamic scaling. TairBloom is compatible with all the commands of the RedisBloom module. TairBloom is a space-efficient probabilistic data structure that consumes minimal memory to check whether an element exists. TairBloom supports dynamic scaling and maintains a stable false positive rate during scaling.

You can use Redis data structures such as hashes, sets, strings, and bitmaps to implement similar features as TairBloom. However, these data structures may consume a large amount of memory or fail to maintain a stable false positive rate during dynamic scaling. For this reason, TairBloom is especially suitable for checking whether large amounts of data exist and a specific false positive rate is allowed in this situation. You can use the built-in Bloom filter of TairBloom without further encapsulation or the need to create an extra Bloom filter on your on-premises machine.

For more information about TairBloom commands, see TairBloom commands.

TairDoc

TairDoc is a new data structure module of ApsaraDB for Redis.

TairDoc is a document data structure that is fully compatible with RedisJSON. TairDoc supports JSON standards, . TairDoc data is stored as a binary tree to allow quick access to child elements of JSON objects.

For more information about TairDoc commands, see TairDoc commands.

TairZset

TairZset is a new data structure module of ApsaraDB for Redis.

The TairZset data structure allows you to sort score data of the DOUBLE type from different dimensions. This data structure supports the ZINCRBY command. You no longer need to retrieve current data, apply the increments to the data, and then write the data to Redis databases. This data structure also supports all APIs similar to those available for the native Redis ZSET data structure.

For more information about TairZset commands, see TairZset commands.

TairRoaring

TairRoaring is a new data structure module of ApsaraDB for Redis.

TairRoaring can strike a balance between performance and space complexity by means of two-level indexes and dynamic containers. Moreover, TairRoaring uses optimization techniques such as single instruction, multiple data (SIMD), vectorization, and popcount algorithms to improve computing efficiency and deliver efficient time and space complexity. In addition, TairRoaring takes advantage of the strong computing power and high stability delivered by ApsaraDB for Redis Enhanced Edition (Tair) to support a variety of business scenarios.

For more information about TairRoaring commands, see TairRoaring commands.

FAQ

Q: What do I do if a client does not support the commands that are provided by new modules?

A: Two methods are available for you. The first method is to define the commands that are provided by new modules in your application code before you use these commands in your client. The second method is to use the TairJedis client that is developed by Alibaba Cloud based on Jedis.