Riak n00b questions
sean at basho.com
Mon Mar 14 07:49:27 EDT 2011
> 1. For a 3-node cluster with number of copies for each document set to two, is there a way in which I wish to distribute fetch requests uniformly across the three nodes? I realise riak internally fetches the record from whichever node the data is available.
> This is the code I use to fetch values from keys:
> client = riak.RiakClient(host, port)
> bucket = self.client.bucket(bucketName)
> for key in keys:
> post = self.bucket.get(key)
> This would send all fetches to the same node. Is it better to put a loadbalancer in front of the three nodes to distribute the requests uniformly, or is creating a client object lightweight enough that I can dynamically connect to whichever client?
Yes, a very typical configuration is to put a small load-balancer (e.g. haproxy) on each application server that balances request across all of the Riak servers. Then the client need not know about multiple servers and can connect to the load balancer on localhost.
> b. I've been looking for MapReduce tutorials for python client, but couldn't find any. Can somebody point to a sample MapReduce from python client, for example, to retrieve multiple records from Riak? (Given a set of keys [1,2,3,4], retrieve the records for these from Riak using MapReduce).
I don't know of any, but we have a decent number of Pythonistas on the list. Hopefully one of them can help you out.
Sean Cribbs <sean at basho.com>
Basho Technologies, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the riak-users