Pipelining #2259
-
Hi. My team has taken Lettuce into use in a Kotlin grpc service. We have a use case where we need to increment and expire multiple counters in the span of a single grpc request. We'd like to pipeline all these commands and send them to the server in 1 go. What is the recommended way to achieve this with Lettuce? At the moment we share a single instance of Thank you 🙇 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Lettuce uses pipelining as the general mode of operations, the client doesn't await the completion of a command before it sends the next one. If you use the async API, then you can ensure that commands are issued immediately and serially without awaiting continuations/subscriptions/backpressure demand (in contrast to the Coroutines/reactive API). A single connection will give you the best performance. There are other options (e.g. manual command flushing) but that approach requires a connection per process which seems to be more expensive than a single-connection approach. |
Beta Was this translation helpful? Give feedback.
Lettuce uses pipelining as the general mode of operations, the client doesn't await the completion of a command before it sends the next one.
If you use the async API, then you can ensure that commands are issued immediately and serially without awaiting continuations/subscriptions/backpressure demand (in contrast to the Coroutines/reactive API).
A single connection will give you the best performance. There are other options (e.g. manual command flushing) but that approach requires a connection per process which seems to be more expensive than a single-connection approach.