Skip to content
Advertisement

mongoDB vs mySQL — why one is better than another in some aspects [closed]

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.

  1. Why is MySQL faster than MongoDB at join operations?

  2. Why does MongoDB scale better in distributed system?

  3. 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” ?

Thanks a lot!

Advertisement

Answer

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?

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.

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.

The case for this is scenario dependant of course.

Why does MongoDB scale better in distributed system?

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.

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” ?

I don’t know 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…

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement