Spring data couchbase

I added around 900 document to couchbase of two types (Country and Rate) and then trying to retrieve one type Country by extending CrudRepository and using findAll in spring-data-couchbase

public interface CountryRepository extends CrudRepository<Country, String> {

}
.

public interface RateRepository extends CrudRepository<Rate, String> {

List<Rate> findByTopTrue();

List<Rate> findByCountryStartingWith(String country);

List<Rate> findByCountryIsoCode(String isoCode);

}

I created the view all as requested but the result is taking around 10 second , is this normal , note that when I use other methods in RateRepository they are super fast .

I did create also primary index and GSI for top field in Rate .

How can I check if the speed issue is related to couchbase or spring-data ?

hey @shahbour
there might be an improvement on the way. I’ve modified the findAll method to use the asynchronous API in the background, and for some users it has shown to improve performance.

This change is already available in the 2.2.0.BUILD-SNAPSHOT (from master branch), but I plan to backport it to the 2.1.x branch very soon, since there should be a SR2 release of Spring Data “Hopper” later this week.

If you are able to, can you check with the 2.2.0 snapshot? Or wait for the change (DATACOUCH-228) to be merged in 2.1.x and build from source to test it on Spring Data Hopper?

Hello @simonbasle

I just did a test using 2.2.0.BUILD-SNAPSHOT , and it is much much faster almost same as N1QL .

Thanks for the update

Awesome, thanks for confirming that!