Consistency options and performances




We are querying Couchbase with KV and when needed with N1QL queries.

When writing N1QL queries we have to decide which consistency options to choose.
Sometimes it is easy to select the right one, sometimes it’s not.

For example a user can accept to get deprecated datas but it should be better if he can obtain the up-to-date version.

This is hard for us to answer to that dilema because we don’t how to predict the performance differences between a N1QL query with request_plus vs default option. Is a request_plus query will still respond quickly with thousands or millions of documents (100ms / 1s / 10s) and a lot of mutations ?

I understand that the answer is related to documents, indexes and infrastructure but i would like to know if there is best practices or some kind of benchmarks to get an order of magnitude for the different options ?



The Memory-Optimized-Index introduced in CB 4.5 processes lot more mutations per second and you should use that if you expect lot of mutations and queries use request_plus. This index supports tens of thousands of mutations/sec on large data sets.

Additionally, CB 4.5 introduced AT_PLUS consistency level which provides read-your-own-writes level of consistency. This provides bitter consistency than UNBOUNDED.