Mongoid or MongoMapper? [closed]

2019-01-30 03:57发布

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 ?

14条回答
爷、活的狠高调
2楼-- · 2019-01-30 04:21

I have used MongoMapper for awhile but decided to migrate to MongoId. The reason is hidden issues plus arrogance towards users. I had to jump through hoops to make MongoMapper work with Cucumber (succeeded in the end) and to put a couple of patches even the project was simple, but it's not the point. When I tried to submit a bug fix (due to incompatibility with ActiveRecord), they seemingly got pissed off that I found a problem and I was pushed around. While I was testing, I also encountered a major bug with their query implementation, while their testing was tuned in a way that the tests pass. After my previous experience, didn't dare to submit it.

They have a significantly lower number of pull requests and bug/feature submissions than MongoId, i.e. community participation is much lower. Same experience as mine?

I don't know which one has more features right now, but I don't see much future in MongoMapper. I don't mind fixing issues and adding functionality myself, but I do mind situations when they wouldn't fix bugs.

查看更多
看我几分像从前
3楼-- · 2019-01-30 04:23

I hope Below points add values to above answers.

1.Mongoid is completely Rails 3 compatible, and uses ActiveModel all over the place (validations, serialization, etc), where MongoMapper is still focused on Rails 2 and uses the validatable gem for its validations.

2.Mongoid officially supports and works on Ruby 1.8.7, 1.9.1, and 1.9.2 head.

3.Mongoid supports embedded documents more robustly, performing the MongoDB atomic operations on any area of the hierarchy internally. ($set, $push, $pull, etc). With MM you need to explicitly tell it to do these operations.

4.MongoMapper has better relational association support and works like this as default.

5.MongoMapper is more extensible, with a plugin architecture that makes it pretty easy for people to extend it with their own libraries. Mongoid does not have this.

6.MM supports identity maps, Mongoid does not.

7.MM has a larger community, and probably more 3rd party library support. I went crazy on documentation and rdoc.

8.Mongoid supports Master/Slave replication clusters. (Writes to master, round robin reads to slaves) MM does not.

9.Mongoid has an extremely rich ARel style criteria API, MM use AR2 style finders.

查看更多
登录 后发表回答