Hi, We are using spring-data-couchbase in our app and wondering how to handle node and cluster failover?
Node failover is automatically handled by the SDK used in the spring-data-couchbase app.
If you’re looking for cluster level failover, there is a feature available to Enterprise Edition Subscribers called Multi-Cluster Awareness. It can enable failover across clusters. Check with your Couchbase team for more info or contact Couchbase if you’re not yet a subscriber.
Our understanding is that for node failover too, we have to write code to read from replica as that is not handled in spring data couchbase. And that does not work for inserts/upserts as write to replica will fail
That’s not quite correct. After failover, everything will be back to ‘normal’. During the period something has failed but before failover is triggered, you may need to read from replica.
What most people do is enable autofailover with the understanding that the app may be offline for a few seconds if there is a node failure, but they less likely have an inconsistent read.