G2 Crowd User in Computer Software

Reading and Writing Data in Failure Conditions

almost 3 years ago

In Riak, you can set an R value for reads and a W value for writes. These values give you control over how many replicas must respond to a request for it to succeed.

Let’s say that you have an N value of 3 (aka n_val=3) for a particular key/value pair, but one of the physical nodes responsible for a replica is down. With an r=2 setting, only 2 replicas must return results for read to be deemed successful. This allows Riak to provide read availability even when nodes are down or laggy. The same applies for the W in writes. If this value is not specified, Riak defaults to quorum, according to which the majority of nodes must respond.

There is more on replication properties elsewhere in the documentation.