Help on bucket quorums
Alex De la rosa
alex.rosa.box at gmail.com
Sat Jun 28 16:33:02 EDT 2014
Thank you very much for your explanation :) looks much clearer now.
So... is not viable to set anything to 0 as it would make no sense and
fail, and also is not appropriate to set anything to the same value as
"n_value" (in this case 3) as there would be false negatives... so the
adjustments should be between 1 and 2 (the default)... meaning that we can
only increase its speed a bit setting some value to 1 (r = 1 if we want to
read fast, w = 1 if we want to write fast)
For what I see, makes no much sense to change PR and PW... and DW only if
we really really really want strong consistency. Leaving again just the
real need to set "r" and "w" if we want to speed up any of the processes.
Am I right?
On Sat, Jun 28, 2014 at 8:41 PM, Sean Cribbs <sean at basho.com> wrote:
> On Sat, Jun 28, 2014 at 4:55 AM, Alex De la rosa <alex.rosa.box at gmail.com>
>> Hi there,
>> Can somebody help me understand a bit better the bucket quorums? I will
>> use the Python API to write code examples:
>> Imagine we are building a web app like twitter, and we want fast read
>> (although not need to be consistent) and safe writings, this R/W
>> combination is appropriate?
>> bucket = client.bucket('twits')
>> bucket.r = 1
>> bucket.w = 3
>> # OR
>> bucket.set_property('r', 1)
>> bucket.set_property('w', 3)
>> Which method is better to use? or are just exactly the same?
> The pseudo-properties in the first example are exactly the same as the
> set_property() calls in the second, just a convenience. Generally I
> wouldn't recommend W=3 because it will tend to create false negatives under
> heavy load, W=2 (the default) should be sufficient. Keep in mind that R=1
> with notfound_ok = true (the default) can tend to result in false negative
> responses as well.
>> Imagine that in this new case, we want to focus on writing fast (normally
>> we will write more "twits" than read them)... which would be the most
>> appropriate/suggested quorums?
>> Also, what's really the difference between "r" and "pr"? what is a
>> "primary replica"?
> Primaries are the replicas (nodes) that are the canonical owners the data,
> but Riak will let you read and write even if they are not available. If
> they are not available, fallback replicas (non-owner nodes) will take over
> in their place. Setting PR or PW > 0 will result in failures if that many
> primaries are not available (the node is down or partitioned from the node
> that receives the request).
>> If i set up bucket.w = 1, it will still do the 3 copies (n_val) in the
>> background but will reply "true" once 1 copy is saved, right?
> Yes. Keep in mind W is a fast-path response, i.e. "I received the request
> to write", whereas DW is a "I saved the key to the storage engine". There
> is no practical reason for DW ever to be 0, in fact I think it is
> disallowed (or silently upgraded to 1).
>> riak-users mailing list
>> riak-users at lists.basho.com
> Sean Cribbs <sean at basho.com>
> Software Engineer
> Basho Technologies, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the riak-users