使用 Rails 从关系型数据库切换到非关系型数据库是否容易?

发布于 2024-08-21 06:42:50 字数 218 浏览 3 评论 0原文

美好的一天,

我过去一直在使用 Rails/Mysql,但我一直听说 Cassandra、MongoDB、CouchDB 和其他文档存储 DB/非关系数据库。我计划稍后探索它们,因为它们可能是可扩展性的更好替代方案。

我计划很快开始申请。如果我从关系数据库转向非关系数据库,Rails 设计会有所不同吗?我知道 Rails 迁移与数据库无关,但不确定迁移到非关系型迁移是否会对设计产生影响。

Good day,

I have been using Rails/Mysql for the past while but I have been hearing about Cassandra, MongoDB, CouchDB and other document-store DB/Non-relational databases. I'm planning to explore them later as they might be better alternative for scalability.

I'm planning to start an application soon. Will it make a different with Rails design if I move from relational to non-relational database? I know Rails migrations are database-agnostic but wasn't sure if moving to non-relational will make difference with design or not.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

jJeQQOZ5 2024-08-28 06:42:50

MongoMapper 已经足够成熟,可以在生产中使用(例如我就是)。您还可以同时使用 ActiveRecord 和 MongoMapper 模型(我也在这样做)。

在它们之间设置关联非常简单,如下所示:http:// /groups.google.com/group/mongomapper/browse_thread/thread/35d4acabf37e3984#

MongoMapper有一个使用ActiveModel的rails3分支。它最终将成为主干的一部分,但现在如果您想从 get-go github.com/mharris717/mongomapper 使用 Rails 3,则需要使用这个 Rails3 分支

MongoMapper is mature enough to use in production (I am, for example). You can also use both ActiveRecord and MongoMapper models at the same time (I am doing that, too).

It's pretty simple to set up associations between them, as documented here: http://groups.google.com/group/mongomapper/browse_thread/thread/35d4acabf37e3984#

There is a rails3 branch of MongoMapper using ActiveModel. It will be part of the trunk eventually but for now you'd need to use this rails3 branch if you wanted to work with rails 3 from the get-go github.com/mharris717/mongomapper

醉生梦死 2024-08-28 06:42:50

我认为 MongoDB/MongoMapper 现在都已经足够成熟了,你不会真正注意到其中的区别。当这些非关系数据库 ORM 转向使用 ActiveModel 时,这一点将更加正确。这样,它们都将具有相同的底层模块,这将有助于保持应用程序之间的一致性。

I think that MongoDB/MongoMapper are both mature enough now that you won't really notice the difference. This will be doubly true when these non-relational database ORMs move to using ActiveModel. This way, they'll all have the same underlying modules, which will help keep things consistent across your apps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文