Multiple couchbase clusters connection with Springboot

I want to connect more than 1 couchbase clusters in my Springboot codebase using ReactiveCouchbaseSortingRepository. Can you please suggest how to do that?

Cluster A and cluster B. XDCR from A to B. Read from B and update data to A so that B will also have same modifications.

Couchbase version - 5.0.x
java version - 11
Springboot -
couchbase client - com.couchbase.client:java-client:2.7.10

Hi Nitesh,

I can’t answer your question (tagging @mreiche for that), but I will suggest that if you’re planning a new deployment and your reason for having separate clusters is for performance/scalability, then having separate cluster for reads and writes probably doesn’t make sense for Couchbase. With two separate clusters, you lose the ability to immediately read your own writes, since XDCR is not instantaneous.

I suspect you’ll get better performance and have fewer development headaches if you use all of those computing resources to make a single Couchbase cluster.


Thanks @david.nault for the recommendation but i have already evaluated the same and having separate cluster won’t impact consistency for me.

I just want to connect with 2 clusters using same codebase and scenario is already mentioned above.

Just one correction. CB version - 6.0.2

Hey @Nitesh_Gupta did you find any solution? I am also facing the same issue.

see Connecting to multiple buckets on Couchbase cluster with Spring - Stack Overflow

Nitesh_Gupta aakashgupta
Here is the github link with multiple cluster implementation