How this project started

You’ve already read roughly how I came to know about Riak in my first post. Here’s the rest of the story.

In November or December, Tim Dysinger, VP Engineering at Sonian and all-around awesome guy, started expressing his interest in using Riak to back their Ruby apps. Since I was already interested in Riak, I pressed him for a contract to build the Ruby library now known as Ripple, and later Basho signed on as a co-sponsor.

More about the library

The feature list:

A robust basic client, Riak, with:

multiple HTTP backends (curb, net/http)

sensible client defaults (local, default port)

bucket access and manipulation, including key-streaming

object reading, storing, deleting and reloading

automatic de-serialization of JSON, YAML, and Marshal (when given the right content type)

streaming POST/PUT bodies (when given an IO)

method-chained map-reduce job construction

A document-style modeling library, Ripple, with:

ActiveModel 3.0 compatibility

Property/attribute definition with automatic type-casting

Bucket selection based on class name, with single-bucket inheritance (configurable)

Validations

Dirty-tracking

Simple finders – all documents, by key

Reloading

To use Ripple, you need Ruby 1.8.7 or later, and the ActiveModel and ActiveSupport gems from the Rails 3 beta release. Rails 3 will be out very soon, so it might be good to go ahead and get your app ready for it. More details about development and dependencies can be found in the YARD documentation

Usage notes

Ripple has two namespaces. require 'riak' to get just the basic client – this should give you parity with the old jiak.rb included in the Riak distribution, plus a lot more niceties. require 'ripple' to get both the basic client and the (functional but incomplete) object-mapper library.

You’ll need a working developer setup of Riak 0.8 or later. If you have trouble installing, please ask for help on the mailing list.

Some of the specs are failing on Ruby 1.9.

Known Issues

The object-mapper library is incomplete. Most notably missing are associations, which is first on the list to be completed. Work-in-progress is available in the associations branch.

Using a streaming all finder on a Ripple::Document when using the curb backend will render the client unusable because it attempts to request the key reusing the Curl::Easy handle that is doing the streaming. This also affects Riak::Bucket#keys with a streaming block, if the user decides to make requests to the server based on the yielded key.

Roadmap and future directions

The heat really turned up this week, partly thanks to my blog posts over the weekend and the changelog podcast, so I felt compelled to release in an incomplete state. In addition to addressing the known issues above, these features are on the docket (all can be seen on the Github issues tracker):