Mongodb和PostgreSql的想法 [英] Mongodb and PostgreSql thoughts

查看:406
本文介绍了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仍处于beta版本。文档很好,但是有时我发现ODM与传统(SQL)数据库系统提供的Active Record相比非常有限。

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)

推荐答案

你为一个年轻的,beta质量的,特征薄的文档存储而丢弃了经过几十年的测试,功能完备的RDBMS,并且没有社区支持。除非你已经在服务器上每月运行数万美元,并认为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天全站免登陆