0

Exploring CouchDB

Posted November 4th, 2009 in General by ryan

Over the last week I’ve been reading a few articles about CouchDB and playing with some sample code.  Yesterday I read Eric Florenzano’s article on Using CouchDB with Django and it elevated my interest.  CouchDB is a a document-oriented database from Apache.  It can be queried and indexed in a MapReduce function in javascript.  CouchDB also provides an incremental replication feature that finds and resolves conflicts bi-directionally.

Eric’s article provided an example of using CouchDB that didn’t fit what I was looking to do, but provided me with two key pieces of data; an example of using the python library for CouchDB and introducing me to an awesome project CouchDBX.  CouchDBX is basically an InstantCouchDB for Mac OSX.  It was very easy to download and start using CouchDB immediately.

Unfortunately this post has no code sample.  I haven’t slayed CouchDB yet.  Whether I use a Python class that inherits from object or from the couchdb-python library Document object, I end up with a json serialization error “<object> is not JSON serializable”.  It’s annoying, but there’s just something I’m still missing.  I’ll figure out (or some Google searching will).

I’m planning a demo at work.  Since I still work for a Microsoft based shop, most of these alternate technologies are like a traveling freak show from the circus for them.  I do see some places where CouchDB would work well, although security is an issue.  Where I work they want everything protected with CAC’s or certificates of some sort, so I’ll have to eventually look into how to do that with CouchDB.

UPDATE:

I was able to start storing data once I created a proper object.  It seems that a public property of a collection type isn’t json serializable.  I had a property “answers = []” and it was causing the serialization error.  Creating and updating data is working well now.  Time to tackle queries and then replication.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Leave a Reply





FireStats icon Powered by FireStats