views:

2577

answers:

6

I have tried MongoMapper and it is feature complete (offering almost all AR functionality) but i was not very happy with the performance when using large datasets. Has anyone compared with Mongoid? Any performance gains ?

+3  A: 

Did you install mongo_ext? I think the performance is more related to the driver than the mapper itself. When looking at the mongo log, I can see without the extension, that the transer seems to have some lags.

Also do as they recommend on the monogdb site, select only the fields you need.

Piotr Zolnierek
ruby driver is not that fast especially 1.8 but 1.9 just boosts the performance!i am just wondering if mongoid is more optimized or the only thing it offers is a different approach to quering and stufffor the time being mongomapper is almost feature complete offering almost all AR sugar
PanosJee
+1  A: 

sudo gem install mongo_ext is key to getting performance.

MongoDB blows away CouchDB in terms of raw speed – though CDB doe shave its own set of advantages.

Benchmark: http://www.snailinaturtleneck.com/blog/?p=74

Isaac Hodes
He's talking about mongoid x mongo_mapper, what is the faster ruby gem to access mongo, not mongodb x couchdb.
Victor Rodrigues
A: 

I would expect performance to be the same, last time I checked MongoMapper lacked Rails 3 support - so I am looking at Mongoid for now.

Omar Qureshi
+1  A: 

Did some testing with MongoMapper last week, it was stable but I found the query interface a little limited (also some of the AR logic was quirky), switched to Mongoid today and it feels much better to use - and more intuitive if you are used to AR.

No speed conclusions yet - but the switch over was painless - it works with Rails 3 too.

mtkd
+1  A: 

i've been using both for the past couple weeks. Mongomapper has better support for relational associations (non-embedded) and has greater third-party support. Mongoid has better query support, much better documentation (MM has close to none, though a website is supposedly in the works), Rail 3 support (and thus Devise support) and a slightly more active community on Google Groups.

I ended up going with Mongoid.

Nader
A: 

I think Mongoid is very better at configuration and mapping.

rodrigo3n
I think so too. Besides that it feels closer to NoSQL than MongoMapper that it makes you think more in terms of ActiveRecord and therefore SQL. Another plus is the great documentation
PanosJee
Yep! Mongoid website rocks with documentation!
rodrigo3n