I’ve run into a research/alpha/whatever project called CouchDB a couple of times now. It’s yet another “Who needs relational databases? Who needs schemas?” kind of idea. Rather, CouchDB is for taking random documents and banging them into databases, then calculating views on the fly as needed. It’s REST-friendly. Lucene and a web server are built in.

Damien Katz seems to be the driving force behind CouchDB, and his discussion of document-oriented development seems to be a good starting point. Where I think it goes off the rails — no pun intended — is his dismissal of the XML alternative. He doesn’t think XML adds much unless data happens to be in XML to begin with. Now, maybe he wants to invent an XML alternative. But otherwise, I disagree, because I really like attribute-value pairs.

Call me old-fashioned, but I think one of the main jobs of a DBMS is to record and return facts — or, if not facts, than opinions. I’ve argued elsewhere that the predicate-logic view of DBMS shouldn’t be taken to excess — but it shouldn’t be minimized either. Text documents and media files notwithstanding, most of what goes into a DBMS is attribute-value pairs. You can arrange them in a matrix or array for compactness. If that’s too restrictive, you can just list them. In the first case, SQL or maybe MDX is a fine language for extracting them. In the second case, XQuery seems more apropos.

Comments

Keep in mind that XQuery does not require a schema to work. So XML databases work just fine without schemas. In this respect, CloudDB is not any different than an XML database.

He likes name-value pairs too. In fact, that is pretty much the main thing he relies upon!!! He just thinks that XQuery/XML is too complicated because the data can then be quite messy. He prefers simple name-value pairs which get tied to a document without any hierarchies.

CouchDB uses JSON, which has most of the features people like about XML, generally with less bytes of overhead. JSON has more uniform processing semantics across languages, which makes it ideal for transporting simple structures from database to app-server to client.

To boot, CouchDB does support XML using Spidermonkey’s E4X libraries as well. So if you have a bunch of legacy XML data, you can import it into CouchDB without converting it to JSON.