Do i use Mongoid, Mongomapper or Mongomatic as my Ruby ORM for MongoDB?

Angelegt von andi Tue, 23 Nov 2010 17:50:00 GMT

Now that I had a first chance to use MongoDB (through Mongoid) in the wilderness, I decided to move back and reflect on the alternative ORMs for Mongo in Ruby. Which mostly means Mongomapper, though, with Mongomatic, we have a third player in the game.

I found some pretty interesting ressources on this topic. First of all, Peter Cooper passes the question of what mapper to use, to the authors of both, Mongoid and Mongomapper. I recommend to read the article, or at least the yellow boxes featuring the authors opinions. But don’t get confused about the statement Mongoid would support Rails 3, while Mongomapper is still focussing on Rails 2. They are both Rails 3 compatible.

It remains to say that Mongoid is definitley following the style of ActiveRecord, making use of ActiveModel wherever possible and having a Arel-like Query Api, while MongoMapper is rather having its source in the DataMapper world. There is another interesting comparision on the Antrarestrader Blog.

I recommend you to read on by yourself, but i try to put together what i learned about this two orms for mongo:

mongoid:

  • better support for embedded documents
  • better support for very large documents (>500kb)
  • closer to activerecord, by making use of active model and an arel like query syntax
  • very nice and lean documentation to be found on the project website..

mongomapper:

  • better support for reference associations
  • supposedly it has a bigger community, or at least still had a bigger community last summer
  • better plugin interface

mongomatic

  • supposedly it’s faster. there is a benchmark posted on some blog. The benchmark itself can be downloaded on Github
  • it says it focusses on simplicity
Trackbacks

Verwenden Sie den folgenden Link zur Rückverlinkung von Ihrer eigenen Seite:
http://praktikanten.brueckenschlaeger.org/trackbacks?article_id=374

Leave a comment

Comments