MongoDB 和 PostgreSQL 的思考 [英] MongoDB and PostgreSQL thoughts

查看:17
本文介绍了MongoDB 和 PostgreSQL 的思考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个完全可以使用 PostgreSQL 的应用程序.在阅读了 MongoDB 之后,我有兴趣了解该应用程序将如何使用它.几周后,我将整个系统迁移到了 MongoDB.

I've got an app fully working with PostgreSQL. After reading about MongoDB, I was interested to see how the app would work with it. After a few weeks, I migrated the whole system to MongoDB.

我喜欢 MongoDB 的一些东西.但是,我发现我在 PostgreSQL 中执行的某些查询在 MongoDB 中无法有效执行.特别是当我不得不加入几个表来计算一些逻辑时.例如,这个.

I like a few things with MongoDB. However, I found certain queries I was doing in PostgreSQL, I couldn't do efficiently in MongoDB. Especially, when I had to join several tables to calculate some logic. For example, this.

此外,我正在使用 Ruby on Rails 3 和一个名为 Mongoid 的 ODM.Mongoid 仍处于测试版中.文档很好,但有时我发现 ODM 与 Active Record 提供的传统 (SQL) 数据库系统相比非常有限.

Moreover, I am using Ruby on Rails 3, and an ODM called Mongoid. Mongoid is still in beta release. Documentation was good, but again, at times I found the ODM to be very limiting compared to what Active Record offered with traditional (SQL) database systems.

到目前为止,我觉得使用 PostgreSQL 比使用 MongoDB 更舒服.只是因为我可以加入表格并对数据做任何事情.

Even to this date, I feel more comfortable working with PostgreSQL than MongoDB. Only because I can join tables and do anything with the data.

我做了两种类型的备份.一个使用 PostgreSQL,另一个使用 MongoDB.有人说,某些应用程序更适合一种或另一种类型的数据库.我应该继续使用 MongoDB 并最终希望其 RoR ODM (Mongoid) 完全成熟,还是应该考虑使用 PostgreSQL?

I've made two types of backups. One with PostgreSQL and the other with MongoDB. Some say, some apps are more suitable with one or the other type of db. Should I continue with MongoDB and eventually hope for its RoR ODM (Mongoid) to fully mature, or should I consider using PostgreSQL?

还有几个问题:1)哪一个更适合开发类似于Facebook的社交网站.2)哪一个更适合4页标准布局类型的网站(首页、产品、关于、联系方式)

A few more questions: 1) Which one would be more suitable for developing a social networking site similar to Facebook. 2) Which one would be more suitable for 4-page standard layout type of website (Home, Products, About, Contact)

推荐答案

你放弃了一个经过数十年测试、功能齐全的 RDBMS,转而使用一个年轻的、beta 质量的、功能精简的文档存储,几乎没有社区支持.除非您已经每月在服务器上运行数万美元,并且认为 MongoDB 更适合您的数据性质,否则您可能会浪费大量时间来获得负面收益.MongoDB 玩起来很有趣,出于这个原因,我自己使用它构建了一些应用程序,但它几乎从来没有比 Postgres/MySQL/SQL Server/etc 更好的选择.用于生产应用程序.

You dumped a decades-tested, fully featured RDBMS for a young, beta-quality, feature-thin document store with little community support. Unless you're already running tens of thousands of dollars a month in servers and think MongoDB was a better fit for the nature of your data, you probably wasted a lot of time for negative benefit. MongoDB is fun to toy with, and I've built a few apps using it myself for that reason, but it's almost never a better choice than Postgres/MySQL/SQL Server/etc. for production applications.

这篇关于MongoDB 和 PostgreSQL 的思考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆