Compared with ApsaraDB for Redis Community Edition, the performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) provide enhanced multi-threading performance and integrate multiple Redis modules. This topic describes the features and benefits of the Redis modules that the performance-enhanced instances provide.
Similar to open source Redis, ApsaraDB for Redis Community Edition supports multiple native types of data, such as strings, lists, hashes, sets, sorted sets, and streams. These types of data support common development scenarios, but do not support some complicated scenarios. To manage complicated workloads, you must modify application data, run Lua scripts, or make other required adjustments. The performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair) integrate multiple Redis modules developed by Alibaba Cloud to better support the complicated scenarios. The integrated Redis modules include TairString, TairHash, TairGIS, TairBloom, and TairDoc. These modules help you develop more advanced applications and allow you to focus on business innovation.
You can use the TairString module in the following ways:
- Run the enhanced commands to process strings on performance-enhanced Redis instances.
These commands include Compare And Set (CAS) and Compare And Delete (CAD), which enable simple and efficient Redis distributed locking. For more information, see CAS and CAD commands.
- Use the TairString data structure and relevant commands.
TairString uses a key-value pair structure that is attached with a version number. Compared with native Redis string data without a version number, TairString supports more complicated scenarios. TairString also limits the range of the results returned for Redis strings by certain commands such as INCRBY and INCRBYFLOAT. You can use these commands to increase or decrease values. If a result is out of range, an error message is returned.
For more information about the commands supported by TairString, see TairString commands.Note The data structure of TairString is different from that of the native Redis string.
TairHash is a new data structure module of ApsaraDB for Redis.
TairHash is a hash data type. Similar to native Redis hashes, TairHash data supports multiple commands and provides high performance in data processing. TairHash also allows you to set the time-to-live (TTL) values of both keys and fields and specify the versions of fields. In contrast, native Redis hashes only allow you to set the TTL values of keys. These powerful TairHash features help you simplify application development. TairHash uses an efficient Active Expire algorithm to both check the TTL values of fields and delete expired fields. This process does not increase database response time.
For more information about the commands supported by TairHash, see TairHash commands.
TairGIS is a new data structure module of ApsaraDB for Redis.
TairGIS uses R-tree indexes and supports Geographic Information System (GIS) API operations. Redis supports GEO commands that are suitable for Geohash strings and sorted sets. The GEO commands support geospatial indexing for one-dimensional arrays. This allows you to query points. TairGIS supports indexing for two-dimensional arrays. This allows you to query points, lines, and planes. You can use TairGIS to check intersection or inclusion relationships. TairGIS provides more powerful features.
For more information about the commands supported by TairGIS, see TairGIS commands.
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.
For traditional Redis data structures, such as hashes, sets, strings, and bitsets, you can use bitmaps to implement features similar to TairBloom. However, these data structures may consume a large amount of memory, or fail to support dynamic scaling at a stable false positive rate. TairBloom can be used to check whether large volumes of data exists. In this case, a certain false positive rate is allowed. You can use the Bloom filter built in with TairBloom without further development or the need to create an extra Bloom filter.
For more information about the commands supported by TairBloom, see TairBloom commands.
TairDoc is a new data structure module of ApsaraDB for Redis.
For more information about the commands supported by TairDoc, see TairDoc commands.
Q: What can I do if a client does not support the commands for new modules?
A: You can define the commands for the new modules in your code, and run them. You can also use the TairJedis client developed by Alibaba Cloud.