javaredisjedislettuce

Understanding redis pipelining in lettuce


We are evaluating redis clients between jedis and lettuce. One of the feature we are looking is pipelining commands.

Behaviour in Jedis: We simply call sync on pipeline object to send all the commands to redis. The commands are batched together by client and a single request is made to redis.

How to we achieve the same in lettuce

Any help or references regarding is much appreciated.


Solution

  • You can read my answer to another question which has a bit more detail here.

    but tl;dr:

    The sync interface does not pipeline, but both the async and reactive interfaces do.

    Auto-flushing will pipeline, but it will write commands individually to the socket. You will generally perform better if you flush manually because multiple commands are written to the socket at once.

    In both cases (auto vs manual flushing) you can send multiple requests before awaiting the results