CouchDB 2.0 adds clustering and an easier query language

The latest release of the NoSQL database lowers the bar to entry with an easier-to-use query language, and adds clustering to provide scale-out power

Nearly two years after its initial availability as a developer preview, version 2.0 of the Apache Software Foundation's NoSQL database solution CouchDB is finally out.

Many of the major features address performance, especially CouchDB's newly added support for clustering. But the most notable improvement appears to be a query language that helps address the long-standing complaint that CouchDB is tough for beginners to work with.

Easier to talk to

Mango Query is based on a MongoDB-like syntax that was donated by commercial CouchDB outfit Cloudant (now part of IBM) under its original name, Cloudant Query. CouchDB has given it a new name and reintroduced other features separately developed by Cloudant, such as full-text search.

Mango is far easier to work with than the JavaScript-based Views query system CouchDB used before. Views involved writing a map-reduce function, even for relatively trivial operations. Queries in Mango, though, are JSON structures passed to a REST API via HTTP POST.

Developers can now run Mango queries without having to first construct an index for a CouchDB instance, thereby solving another common complaint.

The upshot of all these changes: CouchDB should be a lot more useful from the outset, easier to dive into and start experimenting with, and less difficult to program to overall.

A more cluster-y Couch

CouchDB has also been knocked for not scaling well. To address that problem, version 2.0 adds clustering, another feature built for CouchDB by Cloudant and open-sourced.

Cloudant's inspiration was the Amazon Dynamo distributed key-value store, which shards the database evenly across nodes and keeps redundant copies of each shard. The developer can tune the number of shards and copies if needed, but CouchDB's documentation claims the default settings should suit most scenarios.

According to CouchDB's developers, using clustering requires almost no changes in how existing CouchDB applications work. CouchDB VP Jan Lehnardt noted in an earlier discussion that CouchDB has "always said no to features that we know couldn't be scalable in a cluster or even doable in a cluster," even if he knew it would take time for clustering to show up in the product.

One thing that isn't likely to change with CouchDB is its model for consistency, or how quickly changes made to the database are reflected in queries made against it. With CouchDB, changes are eventually consistent, but not guaranteed to be available at the time they're made.

Many other NoSQL databases have also used this consistency model, although it means they shouldn't be used in situations where every change has to be reflected immediately. MongoDB, one of the other major NoSQL offerings available, is consistent by default, but provides eventual consistency as an option for those who need it.


EmoticonEmoticon