Riak n00b questions

Sean Cribbs sean at basho.com
Mon Mar 14 07:49:27 EDT 2011

Hi Ishwar,

> 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.

> 2. My familiarity with erlang and Javascript is minimal. Would somebody answer if the following things are doable/advisable to do?
>      a. Most of the processes I want to run on the data are in python and php. Is it possible to call these processes from erlang/javascript?

It is not currently, but we are looking into the feasibility of supporting other languages.  However, I might say that if you're already doing Python and PHP, it would be worth your while (and not difficult) to learn JavaScript.

>      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>
Developer Advocate
Basho Technologies, Inc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20110314/10baf765/attachment.html>

More information about the riak-users mailing list