Possible to mix redis modules? chain them together? loading multiple modules at the same time?

Comment From: MeirShpilraien

You can load multiple modules at the same time using MODULE LOAD command (https://redis.io/commands/module-load) at runtime or --loadmodule option at start time (you can specify it multiple times with different modules).

Possible to mix redis modules? chain them together?

I am not sure what you mean by that, if you will better explain the use case maybe I will be able to help. In general, modules can export shared API for other modules to consume using RedisModule_ExportSharedAPI and RedisModule_GetSharedAPI (you can look here for more information https://redis.io/topics/modules-api-ref#section-modules-api-exporting-importing)

Comment From: hiqsociety

basically i would like to create a module that compresses some data and store as disk backed but i would like it to be compressed stored first before being used by other modules.

so what is the loading sequence of the modules? possible to chain them together?

Comment From: MeirShpilraien

I am not fully sure what you mean when saying being used by other modules. Why can't you create a module that introduces new commands to compress and storing the data? then your client can use those new commands in order to send the data to Redis. Make sense?

Comment From: hiqsociety

ok let me ask this way 1. is it possible to have redisql + redisearch load together? 2. is it possible to "upgrade" existing "set" command as a module plugin? e.g. set key "value" where value will be compressed by the new module automatically. is that possible?

Comment From: MeirShpilraien

is it possible to have redisql + redisearch load together?

Yes you can

is it possible to "upgrade" existing "set" command as a module plugin? e.g. set key "value" where value will be compressed by the new module automatically. is that possible?

I do not understand why replacing the set with a new command is not good enough. But if you insist you can use a command filter to intercept all the commands and modify them before they reach the set code (https://redis.io/topics/modules-api-ref#RedisModule_UnregisterCommandFilter).

Comment From: zuiderkwast

I suppose the question is whether the command filters can be chained.

Comment From: MeirShpilraien

Yes https://github.com/redis/redis/blob/08c46f2b867ffc1f7f75c46a60287520236541e7/src/module.c#L7593

Comment From: hiqsociety

seems very difficult to find examples on how to use the command filters, google search shows 13 results. any examples on usage?

Comment From: MeirShpilraien

You can see how RedisGears uses it to override commands implementation: https://github.com/RedisGears/RedisGears/blob/bfa15e73d763c4497ea93329371594eb15fa8fd8/src/command_hook.c#L258

Comment From: MeirShpilraien

@hiqsociety can we close the issue or do you need any further help?