Redis modules make possible to extend Redis functionality using external modules, implementing new Redis commands at a speed and with features similar to what can be done inside the core itself.
Redis模块系统是一种模块化的方式,可以在Redis服务器上实现新的命令,并且可以在Redis服务器上实现新的数据类型。
Redis modules are dynamic libraries, that can be loaded into Redis at startup or using the MODULE LOAD
command. Redis exports a C API, in the form of a single C header file called redismodule.h
. Modules are meant to be written in C, however it will be possible to use C++ or other languages that have C binding functionalities.
Redis 模块是动态库,可以在Redis服务器启动时加载,或者使用
MODULE LOAD
命令加载。Redis导出一个C API,即一个C头文件,名字为redismodule.h
。模块是用C编写,但是可以使用C++或其他语言,它们都可以使用C的绑定功能。
Modules are designed in order to be loaded into different versions of Redis, so a given module does not need to be designed, or recompiled, in order to run with a specific version of Redis. For this reason, the module will register to the Redis core using a specific API version. The current API version is “1”.
模块是为了不同的Redis版本而设计的,因此,模块不需要设计或重新编译,就可以在不同的Redis版本中运行。因此,模块将使用一个特定的API版本来注册到Redis核心。
相关文档: - https://redis.io/docs/reference/modules/ 模块介绍和快速指引 - https://redis.io/docs/reference/modules/modules-api-ref/ 模块api - https://redis.io/docs/reference/modules/modules-blocking-ops/ 阻塞命令 - https://redis.io/docs/reference/modules/modules-native-types/ 模块数据类型 - https://redis.io/docs/modules/ 已有模块列表