Backend Type and W-value

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Backend Type and W-value

Blake Schwendiman
If I wanted to create a cluster of six Riak servers and had three using a file-based backend and three using a memory-based backend, is there a way to configure the W value to ensure that writes are always stored at least once on disk? I realize that setting W to 4 would do that, but is there a general way to specify the W value for any arbitrary mix of nodes in such a way to take advantage of the speed of memory access and the durability of disk access?

Also, does the client have to wait until all W writes have occurred before returning or can it be set to return after the first write while still having the confidence that all W will eventually happen?

And, another complete noob question, what is the reason to have R > 1? If the data is eventually consistent, shouldn't R = 1 be the most performant setting, assuming the application can deal with short-lived inconsistency?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Blake Schwendiman

Blog: http://www.thewhyandthehow.com/
Facebook: http://www.facebook.com/blake.schwendiman

_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|

Re: Backend Type and W-value

Justin Sheehy
Hi, Blake.

Blake Schwendiman <[hidden email]> wrote:

> If I wanted to create a cluster of six Riak servers and had three using a
> file-based backend and three using a memory-based backend, is there a way to
> configure the W value to ensure that writes are always stored at least once
> on disk? I realize that setting W to 4 would do that, but is there a general
> way to specify the W value for any arbitrary mix of nodes in such a way to
> take advantage of the speed of memory access and the durability of disk
> access?

There is currently no predefined way to configure this behavior in
Riak.  We have discussed making such heterogenous clusters more
convenient, but as to yet it hasn't seemed to be that valuable to many
people.  Some people seem to get a lot of mileage out of using caches
in front of their Riak cluster if they want a mix of transient and
durable storage.

> Also, does the client have to wait until all W writes have occurred before
> returning or can it be set to return after the first write while still
> having the confidence that all W will eventually happen?

This variation is exactly what the W parameter means.  The number you
pass as the W parameter is the number of writes that the client will
block on.  So, set W=1 for the behavior you describe and all N
replicas will be written even though the client will get an "ok" after
the first one is done.

> And, another complete noob question, what is the reason to have R > 1? If
> the data is eventually consistent, shouldn't R = 1 be the most performant
> setting, assuming the application can deal with short-lived inconsistency?

If you don't need read-your-writes consistency, then R=1 is totally fine.

The main reason for turning it down isn't performance (though it will
have some effect) but trading off availability for consistency.  If a
client wants to require that all of its writes are reflected in all of
its writes, then they should make sure that R+W>N.  The biggest
benefit of a lower R-value is increased tolerance for node outages.

I hope that this helps with your exploration of Riak.

-Justin

_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com