View replication

View replication

Couchbase Server provides data replication, which means the server replicates data from one node onto another node. In case the first node fails, the second node can still handle requests for the data.

To handle possible data node failure, you can specify that Couchbase Server also replicate a partial view index for replicated data. By default, each data node in a cluster has a copy of each design document and view functions. If you make any changes to a view’s function, Couchbase Server replicates this change to all nodes in the cluster. The server generates indexes from views within a single design document and store the indexes in a single file on each data node in the cluster.

Couchbase Server can optionally create replica indexes on data nodes that contain replicated data. This is to prepare your cluster for a failover scenario. The server does not replicate index information from another node, instead each data node creates an index for the replicated data (replica vBuckets) it stores. The server recreates indexes using the replicated data on a node for each defined design document and view. By providing replica indexes the server enables you to perform queries even in the event of node failure. You can specify whether Couchbase Server creates replica indexes or not when you create a data bucket.

You can query a view index during cluster rebalance and node failover operations. If you perform queries during rebalance or node failure, Couchbase Server ensures that you receive the query results that you expect from a node as if there were no rebalance or node failure.

This functionality operates by default in Couchbase Server. When enabled, this functionality causes cluster rebalance to take more time. You can optionally choose to disable it. However, we do not recommend disabling this functionality in production without thorough testing as it may cause inconsistent query results.