I have setup mongo database and want to know which one would be best adapter ( mongo_mapper , mongoid, dm-mongo-adapter ) in terms of Associations, include option for eager-loading .
As per my knowledge mongoid would be best adapter for Mongo.
You’re asking which adapter is the best for turning MongoDB into a relational database. That’s not what MongoDB (or any embedded document based database for that matter) is for and it will kill performance if you rely on associations between non-embedded documents. You CAN use an association here and there, sparsely, but it should be the exception rather than the rule.
So, if your application depends on a lot of foreign key associations, use a relational database instead (PostgreSQL, MySQL, …) and don’t jump on a document-oriented database just because it sounds nice.
Now, back to your original question, if a document is embedded (which for MongoDB is more or less the equivalent of a join, albeit in a very very different way), it will get loaded with the record anyway, since it’s an integral part of it. All the adapters you mentioned will do, it depends on which syntax you prefer most. I prefer Mongoid, my colleague likes MongoMapper better. They do both have their strengths and weaknesses (a simple google search for “mongoid vs mongomapper” will give you all the info you need). MongoMapper will probably be YOUR best bet since it stays a lot closer to activerecord relational paradigms, but at the same time it might fuel your old relational habits.
Peter De Berdt
Thanks for suggestions.I have decided to use mognoid