CouchDB and MongoDB: Let our query APIs combine!

By Adam Kocoloski

Why Cloudant chose MongoDB’s query syntax for our database service, and why we’re contributing it back to Apache CouchDB™

Last month at MongoDB World in NYC, we announced that we had released a new declarative query interface to the Cloudant database service. We call it Cloudant Query, and it’s our version of a MongoDB-style find() operation, adapted to run on Cloudant’s distributed database as a service (DBaaS).

Today, I’m excited to announce that we intend to contribute the Cloudant Query functionality to the Apache CouchDB™ project. I want to reiterate a few points from my talk at MongoDB World on the significance of this development.

Track this contribution in CouchDB's JIRA.

Developer adoption is the new standard

Firstly, we want to make it easier for developers to learn and use CouchDB. CouchDB is known for its rock-solid durability and stable REST API, but users new to Cloudant and to CouchDB encounter some educational hurdles. Until now, accessing data was often achieved by creating MapReduce views in Javascript. The new API for declarative querying is simpler and will reduce onboarding time for new users. (See for yourself in this example app.)

Secondly, it’s apparent to us that the MongoDB style of interacting with JSON document data is becoming the de facto standard. Cloudant Query, and its subsequent contribution to Apache CouchDB, is an extension of this belief. We want to make NoSQL development skills portable, so there’s less risk in picking one database over another. In our corner of the NoSQL universe, we want to improve the developer user experience and make it easy for teams to work in a polyglot environment.

It’s still early days, but the industry is beginning to converge on a common set of ways to work with data in document stores. Developing common ways to explore and query data in these systems will have the same effect SQL had on the relational database market 30 years ago.

SQL will surely always be with us. Many relational databases are developing great capabilities around JSON. Fundamentally, however, we think that SQL is not always the best fit for the semi-structured and object-oriented nature of JSON documents, which tend to be complex and nested to arbitrary depths. We believe that a new standard, driven by developer adoption, is the future for declarative querying over JSON data.

CQ webcast July 24. Reg & eat your veg.

Cloudant Query: What we were thinking

Cloudant Query does not attempt to mimic the entire MongoDB API. The system aims for developer compatibility, not API compatibility. That means concepts and syntax are similar, but without breaking our commitment to CouchDB’s REST interface (JSON over HTTP) and remaining true to the design decisions that make CouchDB a rock-solid, scalable operational data store. Cloudant Query should be familiar if you’re used to writing queries against MongoDB using the BSON system and the native drivers, but we’ve taken the MongoDB syntax and adapted it to work in an HTTP-native fashion.

When you invest in learning a new piece of technology — a new query language, a new set of semantics — we want to be able to reward that experience and create additional services that participate in that ecosystem. That’s the thinking behind Cloudant Query. Here’s my talk from MongoDB World 2014, delivered with Dr. Angel Diaz, VP of open standards at IBM:

A product ecosystem for NoSQL

I’ve worked on Apache CouchDB for six years now. Over those years, I’ve watched MongoDB evolve and take off in the market. I tip my cap to Max, Dwight, Eliot, and the rest of the MongoDB team. They’ve done a fantastic job growing their community and recognizing the significance of the developer momentum behind their product.

As a developer, I think that, as the number of database systems that participate in this ecosystem grows, it makes your skills more marketable. Having IBM’s name behind JSON document stores is enterprise validation of the market for this type of data management system.

I hope we’ll soon see a solid product ecosystem where vendors and open communities will take document databases into the next stage of success. There’s a long, exciting road ahead.

Create a free account. It's cool.

Then, replicate example data & follow the CQ tutorial.

Sign Up for Updates!

Recent Posts