CAP question

Justin Sheehy justin at basho.com
Sat Oct 10 18:01:45 EDT 2009


Hi Dan,

On Sat, Oct 10, 2009 at 4:24 PM, Dan Reverri <reverri at gmail.com> wrote:

> This is more of a CAP oriented question

I see no problem with such questions here.  They are well on topic.

> but I was hoping someone on this
> list could confirm or deny my understanding of N, R, and W.
> Is it correct to say that a net split would not be able to create
> inconsistent data if N is set to 3 and R = W = 2?

You're almost right; this would be true if we did not have hinted handoff.

Hinted handoff is the feature that causes nodes to accept requests on
behalf of other (unreachable) nodes, and to help those other nodes
catch up when they become reachable again.  As a result of this, there
will still be nodes on either side of a netsplit accepting writes, and
thus it is possible in a particularly ugly situation (one that would
cause a strong-consistency-only system to be entirely unavailable) for
you to create divergent data that might require a merge.

Your particular choices do lead to one very desirable property,
though.  Whenever (R+W) > N, you will have "read your writes"
consistency.  This means that from the point of view of any single
client, a given read will always reflect the result of all previous
writes from that client.  This property is generally desired from a
least-surprise point of view; systems with "read your writes"
consistency are often much easier for a developer to think about.

Please feel free to ask any other such questions you may have.
Hopefully discussions like this one can help not only yourself but
also other developers to understand what programming on a system like
Riak is all about.

Cheers,

-Justin




More information about the riak-users mailing list