CouchFoo: Like ActiveRecord, but for CouchDB

By Peter Cooper

Apache CouchDB is a "distributed, fault-tolerant and schema-free document-oriented database accessible via a RESTful HTTP/JSON API" that has received quite a bit of publicity in developer circles in the past year. It's written in Erlang, so has all of the scalability and flexibility the Erlang environment brings to the table, but as a RESTful service, you can use it from pretty much anywhere.

George Palmer, a UK-based Rails developer, wanted to use CouchDB but found the existing libraries (such as RelaxDB, CouchREST, ActiveCouch and CouchPotato) lacking - not that they are, as such, but they didn't fit George's needs. George wanted something that was as ActiveRecord-like as possible, so he developed CouchFoo (a.k.a. couch_foo) - an ActiveRecord-style interface to CouchDB.

Basic operations (creating records, finding, and even dynamic finders) are much the same as with ActiveRecord, but there have been some additions to deal with the differences in CouchDB (such as defining properties to get typing or view definitions). Associations (has_many, etc) also work as expected.

This is a clever bit of work on George's part and I know that based on the strong feedback he's had, he's decided to submit a RailsConf proposal on CouchFoo. After taking a look at it, I can only hope his talk gets accepted as I'd love to hear more from someone in the know.

As an aside, back in September 2008, PeepCode released a CouchDB with Rails screencast.