Querying using MapReduce views
Edit on GitHub
MapReduce views support a variety of different use-cases and can be used as a primary index, secondary index, complex secondary indexes using composite keys, and to support basic aggregation using reduce functions.
To query with MapReduce views you must have one of the following administrator roles:
For more information on role-based access, see
Role-Based Access Control (RBAC) for Administrators
View distribution Couchbase Server uses hash-partitioning to distribute data evenly across the cluster. For example, in a cluster with four nodes, on an average each node will contain about 25% of active data.
View operation MapReduce views are scoped within a design document, with each design document attached to a single bucket. View indexes are eventually consistent compared to the underlying bucket documents in the Data service. View updates can happen automatically.
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.
View consistency By default, views in Couchbase Server are eventually consistent. However, an application can alter this behavior using the stale parameter.
View performance View performance depends on different factors including the time taken to update the view, the time required for the view update to be accessed, and the time for the updated information to be returned. The file system cache, frequency of updates, and the time between updating document data and accessing (or updating) a view, all impact performance.