我们正在使用与此类似的动态属性插件:
http://codaset.com/joelmoss/dynamic-attributes
这允许我们将动态属性存储在我们的轨道模型。这些动态属性位于单个数据库列中。因此,我们面临着性能问题,我想知道 MongoId、MongoMapper 或其他 Rails 插件是否允许我们在 ActiveRecord 中保留某些属性(保留 ),但存储动态mongodb 中的属性。我们想要这样做是因为我们需要在现有系统的大部分中继续使用 MySQL,但使用 MongoDB 来存储有关某些模型的动态属性。
基本上这就是我要说的:
http://www .railsinside.com/plugins/242-quickly-add-couchdb-to-existing-rails-models-with-stuffing.html
该插件使用 CouchDB 执行完全相同的操作。
We are using a dynamic attributes plugin similar to this:
http://codaset.com/joelmoss/dynamic-attributes
Which allows us to store dynamic attributes in our rails model. Those dynamic attributes are in a single database column. We are facing performance issues because of this and I am wondering if MongoId, MongoMapper or other rails plugins will allow us to keep some attribute in ActiveRecord (keeping the < ActiveRecord::Base
) but store the dynamic attributes in mongodb. We want to do this because we need to keep using MySQL for most of our existing system, but use MongoDB to store dynamic attributes about some models.
Basically this is what I am talking about:
http://www.railsinside.com/plugins/242-quickly-add-couchdb-to-existing-rails-models-with-stuffing.html
This plugin does the exact same thing using CouchDB.
发布评论
评论(1)
我认为 MongoDB 没有任何理由不能处理同样的事情。
MongoMapper 应该实现 ActiveRecord 模式。不过,Mongo 也有一些简单的 Ruby 驱动程序。总而言之,存储动态属性的概念是 MongoDB 的完美用例。
如果您不介意跳过“ActiveRecord”,您可能可以使用基本的 Mongo 驱动程序自行编写,只需很少的工作。
如果您无法弄清楚执行此操作的步骤,我建议您 ping 各组 (http://groups.google.com/mongodb-user/) 并直接询问 Kyle Banker(他是他们的 ruby 专家)。
I don't see any reason that MongoDB can't handle the same thing.
MongoMapper should implement the ActiveRecord pattern. However, Mongo also has some simple drivers for Ruby. All in all, the concept of storing dynamic attributes is a perfect use-case for MongoDB.
If you don't mind skipping "ActiveRecord" you can probably cook up your own using the basic Mongo drivers with very little work.
If you can't figure out the steps to do this, I would suggest pinging the groups (http://groups.google.com/mongodb-user/) and asking Kyle Banker directly (he's their ruby expert).