Skip to content

Batch multiple commands together #3084

@tishun

Description

@tishun

Feature Request

As a continuation of #3021 (and other similar discussions)

Allow the batching of commands together, so that they are executed atomically over the wire.

This would enable two distinct scenarios:

  1. Make sure that - for a given thread - the batch of commands are executed without any other commands interleaving from other threads.
  2. Enable transactions for shared connections

Is your feature request related to a problem? Please describe

Currently the driver does not guarantee threads would have their commands executed without other threads interleaving their commands, only the order is guaranteed, see https://redis.github.io/lettuce/advanced-usage/#message-ordering

Currently the driver does not support using transactions on a shared connection.

Describe the solution you'd like

The team needs to experiment with batching commands together. This means that - in the concurrent part of the application - a batch would be more or less considered a single command execution. When it reaches the lower levels of the driver the whole batch would be executed atomically and put atomically in the queue.

Describe alternatives you've considered

While the first scenario might not be a huge problem to the community, the second scenario (transactions in shared connections) is often raised by users.

Currently the only solution to achieve the above it so have dedicated connections per threads using a connection pool, but this is wasteful in terms of resources.

Teachability, Documentation, Adoption, Migration Strategy

(design to follow)

Metadata

Metadata

Assignees

No one assigned

    Labels

    size: medium2 to 4 development weeks

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions