I remember the days when I’ve used MongoDB in simple Ruby on Rails (RoR) project using Mongoid. It’s so simple to use MongoDB with RoR without knowing much about it. While using MongoDB, as a project requirement, I became more interested about it and decided to dig more. The moment I wanted to learn more about it, I found the book Ruby and MongoDB Web Development written by Gautam Rege. Thank goes to my colleague Rubayeet Islam, who suggested me this book. When I started reading it, I started feeling at home as I’ve already familiar with several Ruby/Rails/MongoDB concepts that I’ve learned during my works. However, here is my overall feelings about the book.
The first four chapters of the books talks solely about MongoDB. You will learn how to install it, run it, query it, use complex queries etc. and all of these using the default mongodb client.
From the fifth chapter, it started discussion how we will be able to use MongoDB inside Ruby. It starts discussion of using MongoDB using plain ruby driver. Then it continues to discuss about DataMapper. It explains how can we use MongoMapper and Mongoid. Though I started feeling at home (as I’ve used Mongoid in my first project), I’ve learned many things that I did not know. However, I did not like mixing of MongoMapper and Mongoid things. If they would be discussed separately, I could easily jump to my preferred one (if I had any).
Chapter 6 is dedicated for Mongoid. It will go quite deep about Mongoid in Rails/Sinatra. Many advanced Mongoid features are discussed in this chapter.
It goes pretty advance from chapter 7. This chapter covers the techniques for achieving high performance with MongoDB. Among all the chapters, I’ve liked this one most.
Chapter 8 is also interesting. Along with learning how to use MongoDB in Rails/Sinatra, you will also get basic lessons about Rails too. So, if you are not Rails developer already, don’t get afraid, this chapter will help you greatly to get started with the royal journey of Ruby on Rails. However, I guess chapter 7 and 8 could probably be swapped for a better sequence.
I’ve skipped chapter 9 for now and kept for future reference. To be honest, I’m dying to start reading the book Ruby under the microscope.
The last chapter (chapter 10), covered important things about scaling MongoDB including replication, sharding, benchmarking, recover from crashing etc. Probably learning such a technology will be incomplete if we do not learn how to scale it, as well as disaster management. It also described how to implement Map/Reduce in Ruby.
There are several issues with this book. There are issues with the sequence of the stuffs. I believe, it could be better organised. I can give several examples but I’ve added 2 issues in the footnotes. As this edition is already published, a second edition is something highly recommended for this book. The editors should probably be more careful for that edition.
If you already know some Ruby and are interested about MongoDB, you can certainly start with this book. You will learn some of Rails & Sinatra for free :). While reading, if you feel it’s little scattered, you will certainly get it right after completion of reading which it is really worth of.
- The section “choosing whether to embed or not to embed”. I dont understand what it tried to explain (but in later discussions it clarified better).
- Also I did not get any clear idea about Map/Reduce even though it discussed several times. As a beginner book (and with no assumption that I already familiar with Map/Reduce), its concepts should be discussed well first as this is very important feature of MongoDB.