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 trees or other structures. With CouchDB queries are prepared in advance using proper programming languages and are called views, this lets you grab stuff with a lot more power. It also offers much more flexibility with how you structure your data. (You can have a query that ignores records that aren’t relevant for example.)
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 made some mistakes, it does give you somewhere to start from though.)
Any feedback would be great,