Bulk operations on counters


#1

Hi,
I have a use case where I need to set a lot of counters in batch, and later retrieve them in batch too. I wonder if Couchbase provide batch incr/read on counters?


#2

I’m aware of multiget; I’d like to know if there is a multiincr which would let me increment multiple counters in the same call (only 1 network roundtrip).


#3

Hello,

I am not sure to understand this question, can you please clarify your use case?

Counter operations (incr/decr) are atomic and applied on a single key.

You can read by batch using a multiget, so in this case you will be able to read multiple counter values.

Regards
Tug
@tgrall


#4

No we do not have a “mutliincr”.

Jut a small comment on the “network trip”, (not that important), the multiget does not change a lot the impact on the network, it is more an helper method for the developer.
In call cases the messages are pipelined on the socket, the only difference between a list of simple get compare to a list of multi get is the fact that the “cache misses” are not returned in the context of a multiget they are implicit.

Tug