Hacker News new | ask | show | jobs
by splatcollision 2307 days ago
CouchDB is awesome, full stop.

While it's missing some popularity from MongoDB and having wide adoption of things like mongoose in lots of open source CMS-type projects, it wins for the (i believe) unique take on map / reduce and writing custom javascript view functions that run on every document, letting you really customize the way you can query slice and access parts of your data...

Example: I'm building a document analysis app that does topic + keyword frequency vectorization of a corpus of documents, only a few thousand for now.

I end up with a bunch of documents that have "text": "here is my document text..." and "vector": [ array of floating point values ...].

What I can do with couchdb is store that 20d vector and emit integers of it as a query key:

    var intVectors = doc.vector.map(function(val){
      return Math.floor(val)
    })
    emit(intVectors, 1);
Then I can match an input document's vector (calculated the same as corpus documents), calculate a 'range' of those vectors, pass it as start and end keys, and super quickly get a result from the database of 'here are documents that have vectors similar to your input'...

Super fun, quick and flexible to work with!

2 comments

> CouchDB is awesome, full stop.

I really like CouchDB. It is wonderful if you want that kind of DB. However, if you want a relational DB (and there are many, many, many reasons to want one), do not pick CouchDB. It works very poorly as a relational DB.

I have a legacy project that didn't quite understand this point and we have ended up paying the price for a document oriented DB in which it is hard to migrate and where we are constantly having to worry about the bandwidth to the view server. And then all the amazing, wonderful features of couch? We don't use a single one :-P Fail all the way around. However, I still like it and instead of retiring it, I've been slowly trying to start using the features that make it awesome, while mitigating some of the problems that have piled up over the years.

We're in a similar boat. My main goal this year is to retire it.
>CouchDB is awesome, full stop.

The problem I had with CouchDB is integrating it into a framework like Rails. CouchDB on its own does so much cool stuff. The "free" HTTP API and client replication via PouchDB are the two huge ones. But it just wasn't smooth enough to get the data out, use it where I wanted, and then save it back.

I had to write my own libs/helpers to interact and make it feel friendly to the developer when I used it with Rails in the past.

But after that, it was very nice.

Did you open source these by chance?