Search code examples
redisspring-data-redislettuce

RedisTemplate executing get vs multiget performance difference


In RedisTemplate i understand that executing get multiple times will end up making multiple network calls to the redis cluster and then will retrieve the result. Will the same happen in case of multiget or the multiget will pass all the keys at once to redis cluster and then execute them in the structure of pipeline and then return the result.

I have tried googling it but could not find any reference regarding it.


Solution

  • So it looks like that a multiget is not like executing multiple get in a loop, rather multiget will pass the whole operation on redis cluster side and do the caldulation on redis cluster and then pass the data to the client