Day 19: MongoDB
Last night, Ren and I checked out MongoDB, a document-oriented database that claims to bridge the gap between key-value stores and traditional RDBMSes. Mongo is one of the technologies at the forefront of the NoSQL movement — which, in a nod to political correctness, apparently now stands for “not only SQL” — and has been getting a lot of good press in the Ruby on Rails community. This post by John Nunemaker, for one, served as a call to action to many Ruby devs that it might be time to step away from the typical MySQL-backed app.
After working through the basic examples, I decided to investigate how to write complex queries against Mongo. The official docs were somewhat obtuse, but this post by Kyle Banker proved to be much more helpful. In fact, it’s the last of a series of three very well-written posts. All highly recommended. Ren took a look at GridFS, Mongo’s solution for storing large chunks of binary data. I’m still not sold on it as a solution for storing uploads; you’ve long been able to store binary data in an RDBMS, but it turns out that we already have a great system for storing files … the filesystem.
MongoDB is clearly awesome, and I’m glad to have a better sense of its internals. I’ll be on the lookout for a project where a document-oriented database seems appropriate. I wonder if the changes to ActiveRecord in Rails 3 will bring SQL back into vogue or if more and more devs will make the jump.