Lisp, CouchDB and cl-couch example usage

Auto Date Friday, December 26th, 2008

I have been reading up on CouchDB, an interesting alternative to using relational databases for (usually) completely the wrong purpose. After the last contract I have been working on and having to deal with the mess that led to I can really see the need for tools like this.

I always thought it was weird how you ended up having to do loads of queries per page viewed, how you are limited by SQL when doing anything more complex things and buggered when it came to storing tree’s or other structures. With CouchDB queries are prepared in advance using proper programing languages and are called views, this lets you grab stuff with a lot more power. Also interesting was the idea that you are not forced into a rigid structure for your data. (You can have a query that simple ignores records that aren’t relevant for example.)

A free online book, friendly IRC channel and a great Lisp library are some of the bonuses to what already looks like a pretty good idea.

Another really interesting part of CouchDB is that it gives you your data in JSON form so you can actually skip the ‘PHP Layer’ and make a dynamic application with just HTML, Javascript and CouchDB! (Just view the source of that page to see!)

I am going to write a couple of basic programs to get the hang of CouchDB soon but before I started I needed to get a few examples working. It took me a while so to save you the bother here is the code:

(I am brand new to this so I might have done some bits in a stupid way, it does give you somewhere to start from though.)

Any feedback would be great,

Cheers, Dave.


3 Responses to “Lisp, CouchDB and cl-couch example usage”

  1. Jan Says:
    December 27th, 2008 at 1:34 am

    Hi Dave,

    thanks for the nice words in all directions!

    A small correction: Your link to the book has a typo. It should be “http://books.couchdb.org/relax” (in fact, you can strip the “/relax”, too :)

    Cheers
    Jan

  2. kzar Says:
    December 27th, 2008 at 10:39 am

    Tah I have fixed that now.

    - Dave.

  3. LispNews (no. 4, Dec 25, 2008 — Jan 7, 2009) « Common Lisp Weekly News Says:
    January 8th, 2009 at 9:27 am

    […] Dave shows how to use Lisp, CouchDB and cl-couch. […]

Leave a Reply

1