ActiveCouch – A Ruby Wrapper for CouchDB
We the nerds actively push ourselves to be on the cutting-edge of current technological happenings. So it was no surprise that when CouchDB appeared on our radar, we jumped at the opportunity to try it out. A flat document-based model for data storage seemed like a good fit for some of our products.
And although CouchDB has an extremely elegant REST API to store/query/view documents, the Ruby-ists here at Bezurk will baulk at the sight of parentheses and braces. Death before inconvenience.
Enter ActiveCouch
ActiveCouch is an open-source Ruby wrapper for CouchDB developed in-house at Bezurk. In Jobs-ian style, version 0.1.0 is out and it ships…today!
Some of it’s functionalities include: convenience methods for creating and deleting databases from a CouchDB database, a Ruby DSL to create permanent views for a CouchDB database, the ability to query and retrieve CouchDB documents in concise ActiveRecord semantics, the ability to persist and delete documents from a CouchDB database and callbacks which enable you to execute methods at specific points in an ActiveCouch object’s lifetime (for e.g. before/after saving).
Like CouchDB itself, this is beta software, but is a living, breathing organism which is constantly evolving.
Docs? We don’t need no stinkin’ docs
Documentation is still a little sparse now, but hey, that’s what specs are for. ActiveCouch follows the BDD Design Principle and so the various specifications included as part of the library act as both documentation and sample code.
Inspired by the Rubinius project, specs are classified in a highly readable layout, with each class having it’s own directory and each method having it’s own spec-file.
Enough already. Where do I get it?
There are various ways to start using ActiveCouch. You can download the gem, issue the following command: gem install activecouch-0.1.0.gem and you are good to go.
[Update: The gem is now available on Rubyforge, so simply run the command 'gem install activecouch' from your favourite terminal (without downloading the gem file).]
If you are a little adventurous, you can always check out the edge version of ActiveCouch from the SVN repository.
Bugs/Feature Requests
Since we are trying out ActiveCouch internally in pursuit of actually using it in production, we are as concerned as you about bugs and so, if and when you find any, please report them here and we will fix them as soon as possible. With feature requests, we do not offer any such guarantees, but we will gladly accept patches (accompanied by spec’s of course).
Looking Forward
We have plenty of ideas on how to take ActiveCouch forward. Better Rails integration, more convenience methods and a super-stable library are on the to-do list. So, stay tuned.
As for now, it’s time to relax in ruby.
January 23rd, 2008 at 8:01 pm
[...] ActiveCouch – A Ruby wrapper for CouchDB Over the last month or so, my colleague from work Chu Yeow and I have been developing an open-source Ruby wrapper called ActiveCouch for CouchDB. CouchDB has been on our radars for quite a while now, with its promise of storing vast amounts of information over a cluster of unreliable commodity hardware, and this is our attempt to make it play nice with Ruby. We believe in eating our own dogfood, and ActiveCouch is currently in the process of being used internally at Bezurk for our various products. More information on ActiveCouch can be found at the project page, as well as at the Bezurk Blog. [...]
January 25th, 2008 at 7:39 pm
I cant wait to try it out
Thanks for making it available!
January 26th, 2008 at 12:09 pm
This is fantastic!!! Thank you very much for sharing it!
A couple of feature requests:
it would be great to add has_one, belongs_to, habtm, and other activerecord-style relations (hm :through, polymorphic relations, etc).
it would be great to had more juice to the “has” statement such as something like (something like Datamapper properties):
has :name, :type => :string, :required => true, :default => ‘Anonymous’, :unique => true, :max => 30
which would automagically create validations for that attribute.
Also, it seems that calling something like Comments.find(:all) complains about not having the params arg, even if I give an empty hash.
Just my two cents… keep up with the great work!!!
Dado
January 26th, 2008 at 3:29 pm
Hi Edoardo – Thanks for your comments and suggestions! We will be doing our best to improve ActiveCouch. Do let us know (I see you’ve already filed tickets :) of any more issues that you come across.
Cheers,
Arun
January 30th, 2008 at 11:09 pm
[...] ActiveCouch – A Ruby Wrapper for CouchDB [...]
February 2nd, 2008 at 2:28 pm
[...] My fellow Rubyist at work, Arun Thampi, has released ActiveCouch, a Ruby library for CouchDB (if you don’t know what CouchDB is, read this). Check out the official blog announcement of ActiveCouch. [...]
February 4th, 2008 at 9:59 pm
[...] ActiveCouch – A Ruby Wrapper for CouchDB – Yet another thing to learn if I had unlimited time. [...]
November 19th, 2008 at 6:34 am
Can you discuss how you use CouchDB(activecouch)?
what kind of objects do you store in CouchDB? how do you integrate the data between CouchDB and your RDBMS?