luwak questions

francisco treacy francisco.treacy at
Tue Feb 22 12:17:37 EST 2011

Hi all,

We are using Luwak to store assets, ranging from 2k CSS files up to
30+ MB video files. Every key in Luwak is prefixed with an id (e.g.

In order to manage these assets, I'd like to query Luwak for keys
starting with some id. As I found the 'luwak_tld' bucket I tried with
two approaches: list all keys and filter out on the client,  or use
key filters.

> db.keys('luwak_tld')
GET /riak/luwak_tld?keys=true

Listing all keys works fine, except when there are too many. I then
tried to filter on Riak, like so:

> db.add({ bucket: 'luwak_tld', key_filters: [['starts_with', 'e276814e96e0616eb7c07d3bb744d333']]}).map(function(v) { return [1] }).run()
POST /mapred
> { message: 'HTTP error 500: {"error":"bad_json"}'
, stack: [Getter/Setter]
, statusCode: 500
, notFound: false

but I get "bad_json" errors... Any other bucket works just fine. Why
won't this work like a regular bucket?

Additionally I'm concerned about key explosion. Tens of thousands of
assets would end up stored there - would it make sense to organize
data differently?

I was thinking along the lines of one bucket per book (for instance a
bucket would be e276814e96e0616eb7c07d3bb744d333), with its assets
contained in that bucket. But I would lose the advantages of Luwak.
How would you go about this?


More information about the riak-users mailing list