Couchbase and Ephemeral Bucket setup in springboot

Hi Everyone,

I need help on how to connect one couchbase bucket for database purposes and one ephemeral bucket for caching in a single springboot app. I am using springboot version 3.4.0 and using the CouchbaseRepository interface. I have tried to look for a solution on google and chatgpt but unable to find one. Can someone help me with this along with providing a sample config class code and any other important piece of code if needed?

The bucket needs to be created outside of spring-data-couchbase. It can be created with the Web UI or with the Couchbase Java SDK. The Java SDK can be accessed directly from a repository with repository.getOperations().getCouchbaseClientFactory().getCluster()

There is a sample configuration in the Installation and Configuration section
https://docs.spring.io/spring-data/couchbase/reference/couchbase.html

There are sample applications here

GitHub - spring-projects/spring-data-examples: Spring Data Example Projects → couchbase

There are many samples in the test directory of the spring-data-couchbase repository.
GitHub - spring-projects/spring-data-couchbase: Provides support to increase developer productivity in Java when using Couchbase. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access. → src/test

1 Like