MongoDB Mongoid 自己出了一个 MongoDB driver - Moped

huacnlee · 2012年05月24日 · 最后由 huacnlee 回复于 2012年06月21日 · 4160 次阅读

并且准备用 Moped 在 Mongoid 里面替代 MongoDB 官方的 Ruby Driver。 具体原因不确定,看了一下介绍,也没有提及 https://github.com/mongoid/moped

找到了官方的答复:

原文

I'll have a detailed post on this at the end of the week, including full performance numbers, motivation, design decisions, etc. But to quickly answer your questions.

  1. The implementation is quite different, and pull requests to the official driver that changed design (a long time ago) were not accepted.

  2. Our driver and bson implementations are faster, even in pure Ruby, so there was no need to do native C. (It also makes it more stable across various operating systems, and JRuby users don't get penalized anymore - it's faster on the JVM than the Java bson implementation.)

    First run numbers are here: https://gist.github.com/1844063 with more optimizations to come from us as well.

  3. Origin is basically just there to be a DSL to build query selectors, and has no dependency on any other gem. I wanted to do this so others could utilize the DSL that Mongoid has for it's criteria without needing to use Mongoid, or depend on any driver.

我的理解

  1. 这个实现是有很大不同的,MongoDB 官方 Ruby Driver 不会接受这种改变了设计的 Pull Request。
  2. 我们的 Driver 和 BSON 实现是更快的,哪怕它是纯 Ruby 的,所以不在需要基于 C 了。(这能让它在不同的操作系统中稳定运行,并且 JRuby 用户再也不用受罪了 - 它的速度比 Java BSON 实现更快。) 这里有运行数据:https://gist.github.com/1844063 以及我们更多的优化的数据。
  3. 起因还是为了构建一个基于 DSL 的 Query 选择器,并且不需要依赖其它的 Gem。我想做这个事情让其他人(需要用 MongoDB 的人)可以不用使用 Mongoid 的 DSL,Mongoid 的 criteria,或依赖任何 Driver。

https://groups.google.com/d/topic/mongoid/vS5hn_659Kc/discussion

好事情。

mongoid organization 最近还 lanuch 了一个 evolver.

是 mongoid 的 migration. 更好的是 framework agnostic 的.. sinatra 也可以用。

关键是 moped 把其中的 bson gem 搞得不兼容了,都命名冲突了。

#5 楼 @qichunren 还好啦,Ruby China 现在已经升级到 3.0.0.rc 啦 就是这段时间需要正对新的 3.0 API 调整各个 Gem 而已,以后就好啦

需要 登录 后方可回复, 如果你还没有账号请 注册新账号