Be ahead of the trend, try CouchDB

I always loved and hated databases. When I was a younger programmer, I asked to switch to DB administrator and, thank God, they didn’t agree to let me mutate in a DBA. I ended up fired like 80% of the company (except the DBA). In fact, I wanted to be DBA because I thought I knew how to work with a DB better than them. The rest of my life proved me wrong. Nobody knows what they’re doing because relational databases are a mess.

Then came the non-relational database. Amazon’s SimpleDB was the first NRDBMS (as opposed to RDBMS) that got a public attention. When I read the specs, I really thought it was cool but I wondered “Is it scalable?”. Then I remembered that there is no such thing as a scalable database. Databases need to be smashed and hurt in order to be as scalable as we want them to. I wanted to give it a try but I wasn’t ready to pay for it yet.

Working with xmpp/jabber, I saw a post by the well-known metajack (his blog is mainly about xmpp) about couchdb and I knew the time as come for me to be different. I had to try it so I opened a terminal and wrote sudo apt-get install couchdb. This was the beginning of a great adventure for me…

What’s the link between CouchDB and Javascript? CouchDB is completly JSON. You can write an application that is completly JSON/Ajax without a single line of PHP/Ruby/Python/whatever.

I’m currently writing a simple app for CouchDB and this is the first of some posts about writing an app with CouchDB. I currently use version 0.8.0 and I ran through a lot of problems and I wish these posts will help you succeeding in building an application supported by CouchDB without all the hassle I went through.

Because my main project is TimmyOnTime (and don’t forget to check out our new blog behind the clock), I will work partial-time on this project so it might not go as fast as I (and you) want. But don’t despair, you will still be ahead of the trend when NRBDMS will go mainstream.

  • Dan
    @Sergio we do not use couchDB for TimmyOnTime. First, it's in Rails and Rails is not "NoSQL ready" yet. Also, before using it on a commercial product, I would like to know it better on smaller projects. We use XMPP4R for Timmy, we tried Jabber::Simple without much success but I think that for a simpler project, it would be OK
  • Sergio
    Thanks for the article, really enjoyed it. What library did you use for TimmyOnTime, i assume you are using xmpp. Did you manage to use couchdb for TimmyOnTime.
  • Dan
    @J Chris Anderson
    Your comment was stuck in the spam. The work you're doing for couchdb is incredible. I can't wait myself to work on that couchdb project. It will be really simple... almost too simple. But I want to try couchdb and a new kind of interface at the same time.
  • I'm working on a set of helper scripts called CouchApp designed to keep everything super easy, when you're building pure-CouchDB / JS apps. I opened a new mailing list last night, its here: http://groups.google.com/group/couchapp

    Also you can see the source code here: http://github.com/jchris/couchapp/tree/master

    Enjoy! I can't wait to see what you come up with. A few of the other apps using CouchAPP are linked fromt the README of the source code.
  • Dan
    @Damian
    I'm building a "personal" app (that might evolve in a public project) so I don't need security or things like that for the moment. I remember seeing something about security and I can't wait to try it.

    @Martin
    The main reason that I'm working with the 0.8.0 (the latest release) is that I installed the trunk once and it was more buggy. Also, being on Ubuntu, it was the easiest to install. I will retry the trunk soon!
  • You might want to use the latest trunk of CouchDB as there has been a lot of progress since 0.8.0.

    Once you've started going into detail you could submit your feed to the planet (planet.couchdb.org).
  • I had great fun with an older version of CouchDB writing a database explorer using just HTML, CSS, and JavaScript -- sadly this has since been superseded by Futon, but the point was getting a basic system up and running was refreshingly straightforward.

    I think things get more complicated once you get in to authentication and permissions on different documents, but I gather more recent CouchDB versions have hooks for doing that on the CouchDB server as well.
blog comments powered by Disqus