The NoSQL world is vast: Cassandra, MongoDB, CouchDB, Redis, HBase, Couchbase, Neo4j, BigTable and so on. Not to mention Map-reduce, Hadoop, Hive that are quite close to NoSQL concepts… All these tools have recently been released to process very large amounts of data, what is called “Big data”. Take the example of Facebook, LinkedIn or Instagram with their millions of users and you will understand why relational databases have reached their limits.

The first relational databases were released in 1979 by Oracle, it’s been over 30 years they are used and they still may be used for a long time. While the first NoSQL databases have emerged 7 years ago, if we take into account Google as the NoSQL pioneer with its BigTable technology in 2006.

For us, developers, it has become difficult to navigate in this jungle of technologies. It would need plenty of free time and energy to test all of this. Moreover, the projects we are working on are often not facing the same issues (a few hundred users at most). In this case, a classic relational database such as MySQL will do the job!

This article is not an introduction to NoSQL, I suggest you read this article or this very complete document. They were written between 2010 and 2011. They are a bit old, but they are still accurate to understand the basics.

I will focus on these two NoSQL document-oriented databases. “document-oriented” or “document store” means that a key (identifier) matches a unique “document”. Don’t think about a complex document, but a simple JSON formatted text.

Couchbase and MongoDB databases are widely used today. They compete in a market, you will understand, quite saturated. Having used MongoDB (thanks to the 10gen training) and being aware to Couchbase (BruJUG session), I will make a comparison (probably not very objective) of the two systems. Things are changing so fast that I guess this article may be outdated in a few months…

A little history to begin with; MongoDB was created in 2009 by the 10gen company, Couchbase was created later in 2011 by the company of the same name.

Today, both systems are sharing many characteristics (open source, free, compatible with most platforms, good documentation…), but they differentiate on some points.

Scalability

In Couchbase, you can easily add servers to do clustering and obtain a distributed system, Couchbase is flexible enough to avoid downtime. Indeed, it relies on the power of the Erlang language, a functional and fault-tolerant language that manages hot changes.
For MongoDB, the configuration is a bit more complicated. For example, once you have defined the shard key (the key to distribute documents within a sharded cluster), it becomes difficult to change it afterwards. The system is not as flexible, so you have to think carefully about your data modeling before you move your application into production.
Scalability is why Couchbase is widely used in social gaming, where millions of players can play and their numbers can increase exponentially overnight.

In the end, graphical products seem pretty similar, but the fact that you must register for MongoDB (even if it is free) and that the service cannot be self-hosted… Meh!

Querying data

MongoDB includes a variety of tools to perform queries. There is an equivalent for most of SQL operators, of course making joins is not possible. Someone coming from the SQL world will not be too disoriented and will find some similar concepts such as indexes and secondary indexes. You will find all operators available on this page.
With Couchbase, there are views like in relational SQL. It is a kind of a pre-written query in JavaScript, which is based on the Map-reduce concept. And that’s all! If you want to do more complex operations like filtering or aggregating your data, you must use Elastic Search (there is a Couchbase plugin available). Couchbase has chosen to focus on its NoSQL engine, letting the querying side to specialized search tools.

Conclusion

These two databases are commonly used and are supported by large communities. You will understand there is no winner or loser. As always, adopting a technology instead of another will depend on your needs.

Note
10gen, the company behind MongoDB has finally decided to change its name to MongoDB to avoid confusion. 10gen Education is also renamed as MongoDB University. However, links are still valid and new sessions are organized every year.

Here we are, the new year is here, have you made your resolutions for 2013? What about following some courses on MongoDB? This is what 10gen is offering you.

I have done this training in late 2012. Very interesting and free, this is a really good way to learn NoSQL concepts. The training lasts 7 weeks. At the end of each week, you have some assignments to complete, the last week is dedicated to a final exam. The language used is Python but don’t worry, I’ve never used this language before and the training contains all the necessary explanations, there is no specific prerequisite.

To have a detailed overview of the training, you can download the syllabus.

There is also another training about administration of the MongoDB database. I did not try it, I was only interested in the developer version. New in 2013, the developer-oriented training will be adapted for Java developers, instead of Python.

The following are the dates of future sessions:

MongoDB for Java Developers > February 26, 2013

MongoDB for Developers (Python) > January 21, 2013

MongoDB for DBAs > January 21, 2013

At the end of the training, if you reach a sufficient grade (>= 65%), you will receive a certificate of completion. Last but not least, note that courses are in English.