Rigel Group

They shoot Yaks, don't they?

Light a FUSE Under Your Riak Cluster

As an experiment, we hacked together a FUSE driver in Ruby that lets you mount your Riak cluster as a file system, and browse around. Not sure how really useful it is, but was fun to do nonetheless.

If your Riak keys look like /foo/bar/logo.png, you will be able to ls and cd around the (simulated) directory structure, and cat files (keys).

Things get even more interesting if you hook this up with jsawk, then you can do things like this if your keys contain JSON values:

1
 cat /mnt/riak/users/* | jsawk 'if (this.city != "Paris") return null'

The current implementation does a list keys function when you access a bucket, which of course is slow. We put all the keys into a tree structure and cache that for performance. Another fun project would be to rewrite it using Riak’s Links to simulate the directory structure, and then run interactive map/reduce jobs to navigate the hierarchy. That will have to wait for another time…

Anyway, check it out yourself at Github, just keep in mind it is a toy and should not be pointed at a cluster you care about.