Riak Recap for 4/1/2010

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Riak Recap for 4/1/2010

Mark Phillips-4
Hey All -

Just a few orphaned questions and a blog post you should all check out.

Happy Friday,

Mark

_____

 *Riak Recap for 4/1/2010

1) When I do this: var data = Riak.mapValuesJson(value); My object
properties are at index 0 of an array - i.e. data[0].title - not
data.title. This doesn't mesh with the samples I've seen - is it
expected? (from bubbafat via Twitter)

A----- It seems the examples are in error -- it will always return an
array, even if there's only one value.  See
http://hg.basho.com/riak/src/tip/apps/riak/priv/mapred_builtins.js

2) The mapred interface allows key inputs from mixed buckets (i.e.
[["Movies","123"],["Ratings","12-123"],...] but does not allow
multiple complete buckets (i.e.[["Movies"],["Ratings"]...]) - is this
correct? Or more generally - this appears to be true in 0.9.1 - is
there any plan to change either of those? (from bubbafat via IRC)

A----- Although it has its uses, we generally discourage running
queries across entire buckets for performance reasons, so the short
answer is that there is no plan to change the existing implementation.
One way to overcome this would be to insert a map phase at the
beginning that emits known keys in the second bucket based on the key
or object in the first bucket. Example:

function(value, keyData, arg){
  if(value.bucket == "Movies")
    return [[value.bucket, value.key], ["Books", value.key]];
  else
    return [[value.bucket, value.key]];
}



3) @bkaney posted a great write up of the nosql workshop held at the
Vermonster offices in Boston. It's packed with excellent info and
examples of MapReduce and Link Walking in Riak. Check it out if you
haven't already done so:

http://vermonster.com/2010/03/31/nosql-workshop-featuring-riak-and-couchdb/

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