Hacker News new | ask | show | jobs
by sa_su_ke_75 3617 days ago
what are the new changes of 2.0 version?
1 comments

Primarily merging the changes that Cloudant (now an IBM product) made to Couch to turn a fairly simple implementation of NoSQL / MapReduce into a first-class datastore.

Things like:

* Native Lucene search, which you had to build as a weird add-on for Couch. Now it's full-featured out of the box.

* Geospatial queries, also a weird add-on which only kind of worked in Couch, is also cooked in and is pretty strong now.

* True node clustering and data sharding; Couch has always had really really easy replication between nodes, and getting master-master replication is essentially creating a document on each node. However, you had to store your entire data set on every node, which would grow out of control in a hurry.

* A better auto-compactor. Couch 1.6 does fairly well but it's still a weird cron-based thing that can still fail horribly. The auto-compactor in Cloudant/Couch 2.0 is pretty solid and you don't have to worry about massive spikes in disk space consumption.

Thanks for this list. One of the pain points of CouchDB was management of users: there is only database-level granularity, which is not enough for many applications (and one-database-per-user may not be practical). I know that Couchbase Sync Gateway uses channels (http://developer.couchbase.com/documentation/mobile/current/...) that look interesting.

Do you know if there has been changes on this side for CouchDB 2.0 ?

Managing rights for users on document level granularity was pretty easy in 1.6. A simple js function (it's called a "design document") to handle the logic and you are done. Just an example:

    function(newDoc, oldDoc, userCtx) {
        if (userCtx.roles.indexOf('can-write-sessions') !== -1 || userCtx.roles.indexOf('admin') !== -1) {
            return;
        } else {
            throw ({
                forbidden: 'can-write-sessions role missing'
            });
        }
    }
Why do you think that the Couchbase Sync Gateway is better?
Validation functions give you control on writing, but there is no control on reading: everybody can read everything. That's more or less by design, couchdb would encourage you to create another db for another set of permissions.

Couchbase's channels allow you to segregate docs with different read (or write) rights inside the same db.

It's not just rights, but the ease of doing data routing with channels. For mobile, having a full stack of an embedded mobile db, sync, and backend server solves a lot of problems.
Thanks. but i have listen also that there isn't no more need to make replication between a node and another node at level db by hand or automated. But is live if with the cluster i can see a big database replicated on all nodes
Cool! One question: CouchDB is written in Erlang and Lucene is Java. So CouchDB is now a dual language project, implementation wise?
I think what they're saying is that it used to be CouchDB -> Addon -> Lucene, where it's now just CouchDB -> Lucene. It still requires a separate component in Lucene; it just doesn't require maintaining another separate component.