mongoDB vs mySQL——为什么在某些方面比另一个更好
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17017010/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
mongoDB vs mySQL -- why one is better than another in some aspects
提问by Vendetta
I am really new to database and am interested in some high level basic knowledge. I have read this wonderful SO post. I under one is better than another in some cases, but not sure why.
我对数据库真的很陌生,对一些高级基础知识很感兴趣。我已经阅读了这篇精彩的 SO 帖子。在某些情况下,我在一个之下比另一个更好,但不知道为什么。
Why is MySQL faster than MongoDB at join operations?
Why does MongoDB scale better in distributed system?
Why is MongoDB faster if I am "just selecting a bunch of tables and putting all the objects together, AKA what most people do in a web app" ?
为什么 MySQL 在连接操作上比 MongoDB 快?
为什么 MongoDB 在分布式系统中伸缩性更好?
如果我“只是选择一堆表并将所有对象放在一起,也就是大多数人在 Web 应用程序中所做的事情”,为什么 MongoDB 会更快?
Thanks a lot!
非常感谢!
回答by Sammaye
This question lacks any real research, I mean you say you read that question but either that question has some real problems with the source of its information or...well; anyway:
这个问题缺乏任何真正的研究,我的意思是你说你读过那个问题,但是这个问题的信息来源有一些真正的问题,或者……好吧;反正:
Why is MySQL faster than MongoDB at join operations?
为什么 MySQL 在连接操作上比 MongoDB 快?
Because it doesn't have any? MongoDB HAS NO SERVER SIDE JOINS. I am sorry to put that in capitals but I say it soooooo often, I just feel like placing it as the defacto answer for most questions.
因为它没有?MongoDB 没有服务器端连接。我很抱歉把它放在大写字母中,但我经常这么说,我只是想把它作为大多数问题的实际答案。
Any joins you do are client side. This means they will actually be slower than MySQL, or other SQL techs. The important idea behind doing joins client side is that doing them server-side becomes very hard to scale in huge distributed environments, if not impossible. That is why many big SQL users actually attempt to prevent huge joins and are effectively trying to do in SQL what MongoDB does.
您所做的任何加入都是客户端。这意味着它们实际上会比 MySQL 或其他 SQL 技术慢。加入客户端背后的重要思想是,在巨大的分布式环境中,如果不是不可能的话,在服务器端进行连接变得非常困难。这就是为什么许多大 SQL 用户实际上试图阻止巨大的连接,并在 SQL 中有效地尝试做 MongoDB 所做的事情。
The case for this is scenario dependant of course.
这种情况当然取决于场景。
Why does MongoDB scale better in distributed system?
为什么 MongoDB 在分布式系统中伸缩性更好?
http://docs.mongodb.org/manual/replication/is very important here and so too is http://docs.mongodb.org/manual/core/sharded-clusters/and I would recommend reading both carefully and how they scale to data partitions and what not.
http://docs.mongodb.org/manual/replication/在这里非常重要,所以也就是http://docs.mongodb.org/manual/core/sharded-clusters/,我会建议仔细阅读都和它们如何扩展到数据分区和什么不是。
Why is MongoDB faster if I am "just selecting a bunch of tables and putting all the objects together, AKA what most people do in a web app" ?
如果我“只是选择一堆表并将所有对象放在一起,也就是大多数人在 Web 应用程序中所做的事情”,为什么 MongoDB 会更快?
Dunno what you mean by that.
不知道你说的是什么意思。
I realise this isn't much of an answer but your question is one of those defacto questions and so I answered with a defacto answer.
我意识到这不是一个很好的答案,但你的问题是那些事实上的问题之一,所以我回答了一个事实上的答案。
Since you are new to databases in general I would personally recommend you go use one...
由于您通常不熟悉数据库,我个人建议您使用一个...