MongoDB The Definitive Guide: The Definitive Review

One of the advantages of being a programmer in New York City, the greatest city in the world, is there are so many companies and individuals contributing to open source. One of these companies is 10gen, the creators of MongoDB, and two individuals that work as developers for 10gen are Kristina Chodorow and Mike Dirolf. I met Kristina at her NYPHP talk where I was introduced to MongoDB. I eventually became a user of and contributor to MongoDB. As a result I met Mike, and other members of the 10gen team.

Due to this convenience of geography I was  able to get my copy of MongoDB: The Definitive Guide signed by its co-authors, the aforementioned Kristina and Mike.

My autographed copy of MongoDB: The Definitive Guide

So right now you’re probably saying, “wait this will probably be the most biased review ever!” Well, I’ll seriously consider re titling this post MongoDB The Definitive Guide: The Definitive Fanboy Review. Until then, on with the review.

When my book first arrived from, my first reaction was, “this is kinda thin for an O’Reilly book.” However, 192 pages makes sense for a book about MongoDB. MongoDB is a young small codebase. If you compare it to MySQL, or a more full featured database like Postgres, there are many full chapter topics, like triggers, that simple don’t have an equivalent in MongoDB. Finally, some topics are just plain simpler in MongoDB. For example, even though mongo has DBRefs (actually the drivers support this through convention), there are just fewer caveats about them than database joins. Therefore, this book is short for the same reason that The C Programming Language by K&R is short, there’s not a lot to talk about.

Now on to the content. Few people will read this book cover to cover, but its written in such a way that you can do so. However, if you want to go from mongo n00b to seasoned novice reading through the book is the way to go. Chapter 1 is the introductory chapter that explains how Mongo is so different. 2-7 covers the topic most programmers would be interested in, basic and advanced CRUD (Create, Insert, Update, and Delete) operations. Chapter 8, Administration, deals with the typical sysadmin things like starting, stopping, backing up, and monitoring mongo. 9 and10 deal with system architect topics, sharding and replication respectively. Finally chapter 11 gives you some example applications, and you have 3 appendices of reference information.

The book is really thorough about the material it covers. The syntax for CRUD operations is very thoroughly described, and performance implications  of various operations are discussed. I noted the fact that the section on the “$or” operator did not mention it was new in 1.6. However, this book will be used long after “$or” or the 1.6 series is new, so my belief that this was an oversite will soon become obsolete.

The sharding and replication chapters cover real world implications and best practices. Of course one would expect this considering these are the two showcase features of MongoDB. Kristina and Mike do not disappoint here.

My only comment on the example chapter is that I wish the same example was used for all the languages. It would be much easier to compare and contrast features that way. Then again others might have found the repetition a little boring.

All in all I have to say I definitely recommend this book.