Couchbase 2.x equivalent for Couchbase 1.x getBulk method in Java SDK

Hey guys

we were using couchbase client 1.4.7, and now we are trying to migrate to the latest version
I noticed that the getBulk method in CouchbaseClient (inherited from MemcachedClient)
has disappeared, and there is no similar bulk methods in the latest version
I would like to know the motives behind this and if there is any performance implications, and what would be the equivalent for this in 2.x

Thanks in advance.

Hi Zakaria,

In version 2.x it’s possible to fetch documents in bulk using the asynchronous API (you can still process the results in a blocking/synchronous manner if you prefer). Here’s the documentation for Batching Operations which includes some sample code and talks about the motivation:

The previous Java SDK only provided bulk operations for get(). With the techniques shown above, you can perform any kind of operation as a batch operation.

as well as the performance implications:

Inside the SDK, this provides much more efficient resource utilization because the requests are very quickly stored in the internal Request RingBuffer and the I/O threads are able to pick batches as large as they can. Afterward, whatever server returns a result first it is stored in the list, so there is no serialization of responses going on.


Thanks a lot for the explanation. It makes more sens now.