Several noob questions

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

Several noob questions

Blake Schwendiman
Hello,

I am just now getting started with Riak and will be using PHP as the primary programming language. I have a keen interest in Riak as I am the primary software developer for Squidoo and have several other projects that I believe will be a good match for Riak. Currently I'm testing Riak on a single server and already I have several questions that I haven't been able to find in the documentation. So, I'll list my questions here and if there are already well-documented answers, I'd appreciate links because I'm okay to RTM. Also, if there is a mailing-list archive I can peruse, I'd love to know where that is.

1. In a single-server configuration (I realize this is not the normal setup), if the N,R,W value is > 1, what happens? Is it a good idea to set the N,R,W before all of the servers are active, or is it better to adjust the values as nodes are added/removed?

2. Assume I have four Riak servers on IPs 192.168.1.1, .2, .3, .4. When connecting to a server, is it best to normally connect to just one, or should the code connect to different nodes? Assuming I normally connect to node .1, would it be best to always check isAlive() and switch to another node if .1 is no longer working?

3. Is there a way to request more than one key from a bucket in one REST request (but not the whole bucket) without using MapReduce?

Thanks in advance!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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: Several noob questions

Sean Cribbs-2
Blake,

I'm glad you're considering Riak!  I've answered your questions inline.
>
> 1. In a single-server configuration (I realize this is not the normal setup), if the N,R,W value is > 1, what happens? Is it a good idea to set the N,R,W before all of the servers are active, or is it better to adjust the values as nodes are added/removed?
>

N is something you'll likely want to set once on a per-bucket basis, the default being 3 (R, W can be adjusted per-request).  In general, there's not much reason to having a cluster size smaller than your N value, as it results in duplication of data and can make it difficult to recover from failure.  If you have to start with only one machine, set the N value for what you eventually want it to be and then add nodes to grow your cluster larger than N when you're ready to move to production.

> 2. Assume I have four Riak servers on IPs 192.168.1.1, .2, .3, .4. When connecting to a server, is it best to normally connect to just one, or should the code connect to different nodes? Assuming I normally connect to node .1, would it be best to always check isAlive() and switch to another node if .1 is no longer working?
>

It might be best to put a load balancer like ha_proxy in front of your Riak cluster, then your requests can be evenly spread across the cluster and downed nodes can automatically be compensated for.

> 3. Is there a way to request more than one key from a bucket in one REST request (but not the whole bucket) without using MapReduce?

No there is not, however if your client supports keep-alive, you can avoid setting up and tearing down the connection on that request.  Another possibility might be an interface like curl-multi which can perform requests in parallel.

Be sure to contact us via the web form (http://www.basho.com/contact.html) when you're in need of the EnterpriseDS features and enhanced support.

Sean Cribbs <[hidden email]>
Developer Advocate
Basho Technologies, Inc.
http://basho.com/


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