does anyone still remember, that books once came on paper? And they were heavy, usually never under 500pages and had intimidating titles that usually included the words “professional”, “complete guide”, or even “bible”. And they made you walk through the topic from the beginning of time, starting with Adam&Eve, not leaving out the abacus and Babbage’s difference engine – I hardly remember any more how many introductions to object-oriented computing I had to skip in my life…
Luckily, these days are gone for good: The book that comes on paper is almost dead – at least, when it comes to books on computing. The ebook opened up the market for a whole new breed of publications: Short and very focused papers on very specific topics. These papers usually weigh in with rarely more than 200 pages, deal with one topic and one topic only and can be safely digested in about an hour of your precious: Learning Mongoid is a very good example for this kind of “books”.
Mongoid it is
The new publication from Packt Publishing: “Learning Mongoid” by Gautam Rege does exactly what it says: It shows you how to use mongoid. When you pick up this short paper, you should already have your mind set on:
- ruby&rails is good for you
- mongoDB is good for you
The book does not help you with these decisions – which is a good thing (see above)- but it helps you, when it comes to dealing with the one-and-only mapping-framework for mongodb that is still standing.
Although Mongoid‘s documentation has vastly improved in the last year or so, (which is probably one of the main reasons, barely anyone is using mongo-mapper anymore) – scrapping together decent examples for using it still takes some digging. So the book fills the – albeit small – gap between mongoid’s documentation and the myriad of tiny snippets you can dig up on stack-overflow. It is a small book (140pages), but it gives you examples on just about every piece of mongoid’ api along with helpful examples that show you how to use these api’s.
The writing is clear and to the point – boxes point out common pitfalls&things you should look out for when using mongoid. Unlike other books of this nature, the examples do not lead to a complete application: instead, the examples are focused on demonstrating the specific part of the api and do a good job of showing you how to apply concept to a real-world(-ish) example.
The bottom line
I liked it, that the book is short: it touches on every part of the api, giving you a good overview of mongoid: This is often very helpful, when you already know that things like the Paranoia-plugin exist and what their purpose is – when it comes to actually using is, you can still find the specifics online, now that you know what you are looking for.
That being said, the shortness comes at a price:
- some topics come in a little too short: There is probably more about scaling a mongoDB than just getting the formatting of your data-disk right(although it’s a start) – but then again, this is no book about mongodb. But maybe if you touch on the topic this light, you can leave it out altogether just as good…
- the book shows every piece of the api, but it doesn’t help you much with choosing which pattern to use when. Mapping your domain onto a mongoid/mongodb model is not entirely straightforward and there are many ways you can model the same domain with different approaches – and this can be a bit challenging at first, especially when you come from a RDBMS-background. But again: This is not about modeling mongoDB-databases, this book is about mongoid-and-mongoid-only.
- some examples are very terse and you can probably argue, that you can find these kind of examples on stack-overflow and combine it with the mongoid-docs (which are not soo bad to begin with): But having all this stuff together in one place is certainly helpful when you start.
All in all, I liked the book: Even if you’ve been doing mongoid for some time, you will probably find the one or other thing in it you didn’t know yet about mongoid. And if you’re just starting with mongoid and you’re looking for a decent introduction to the whole api, this is certainly the book to go for.