Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch multiple commands together #3084

Open
tishun opened this issue Dec 16, 2024 · 0 comments
Open

Batch multiple commands together #3084

tishun opened this issue Dec 16, 2024 · 0 comments
Milestone

Comments

@tishun
Copy link
Collaborator

tishun commented Dec 16, 2024

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)

@tishun tishun added this to the 7.0.0.RELEASE milestone Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant