-4

In Riak by default data bucket are replicated to 3 different nodes (N=3). Also number of replicas that must respond to a read or write request before it is considered successful are 2 nodes (R=2, W=2).

We know when N is small or equal to R+W, Riak provides strong consistency. So by these default value Riak provides a strong consistency (like MySQL). I can't underestand why some people tell Riak is not strong consistency and it provides an eventual consistency?

Jonas
  • 121,568
  • 97
  • 310
  • 388
Sepehr Samini
  • 963
  • 4
  • 11
  • 15
  • 2
    Because it is *eventual* consistency. Our docs talk about strong/weak and the tunable parameters - http://docs.basho.com/riak/1.3.0/references/appendices/concepts/Eventual-Consistency/ – Brian Roach Jan 03 '13 at 15:37

2 Answers2

2

R and W values (together with PW (primary write), PR (primary write) and DW (durable write)) allows you to tune consistency according to your application's requirements. Even though this can guarantee consistency during normal operation, Riak is still eventually consistent due to how it handles failure scenarios like e.g. network partitioning.

If we assume we have a cluster of 5 nodes with N set to 3 and 2 nodes are partitioned from the rest for some period of time, all nodes will still be able to accept both read and writes according to the previously mentioned parameters. If we further assume PR and PW are set to 0, records can be updated on both sides of the partition while it is in place. This can cause inconsistencies that can not be resolved until the cluster connectivity is restored, thus making the system eventually consistent.

PR and PW allows the user to specify that a certain number of primary partition owners must be present in order for the read/write is to succeed, and if these are set to a value > 0, it is possible that a partitioned cluster may not allow reads/writes to all objects on all nodes during the time the network partition persists.

Christian Dahlqvist
  • 1,665
  • 12
  • 9
1

A better term for what Riak and similar systems offers might be tunable consistency, since they offer the ability to make decisions about the tradeoffs between consistency, availability, and partition tolerance. MySQL and other RDBMS systems, by contrast, go to great lengths to guarantee consistency. This is an expensive guarantee that isn't always worth the cost.

rs_atl
  • 8,935
  • 1
  • 23
  • 28