2

While Couchbase scales well for single key reads, I am observing higher latency when reading batch of 100 keys at a time. Is there a right way to use couchbase-client for batch reads? Currently, the code I have in Scala is:

Observable.from(keys).flatMap(key => {
        rx.lang.scala.JavaConversions.toScalaObservable(
      cacheStorageBucket.async().get(StringDocument.create(key))).filter(_ != null)
      .map(d => key -> d.content().getObj[T])
      })
.toList.toBlocking.single.toMap

Couchbase client version :

    <dependency>
      <groupId>com.couchbase.client</groupId>
      <artifactId>java-client</artifactId>
      <version>2.1.6</version>
    </dependency>
Matthew Groves
  • 25,181
  • 9
  • 71
  • 121
Aparna
  • 463
  • 5
  • 16

0 Answers0