Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 572
CuriousMind Avatar asked Jun 10 '13 04:06

CuriousMind


People also ask

Why MongoDB is preferred over MySQL?

Why is using MongoDB better than using MySQL? Organizations of all sizes are adopting MongoDB, especially as a cloud database, because it enables them to build applications faster, handle highly diverse data types, and manage applications more efficiently at scale.

Why MongoDB is better than other databases?

MongoDB is almost 100 times faster than traditional database system like RDBMS which is slower in comparison with the NoSQL databases. There is no support for complex joins in MongoDB but RDBMS supports complex joins which can be difficult to understand and take too much time to execute.

What is MongoDB and how it is better than MySQL What are the major differences between these two?

MongoDB is a document-based non-relational database management system. It's also called an object-based system. It was designed to supplant the MySQL structure as an easier way to work with data. On the other hand, MySQL is a table-based system (or open-source relational database).

Why should we use MongoDB rather than SQL?

SQL databases are used to store structured data while NoSQL databases like MongoDB are used to save unstructured data. MongoDB is used to save unstructured data in JSON format. MongoDB does not support advanced analytics and joins like SQL databases support.


1 Answers

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...

like image 136
Sammaye Avatar answered Sep 19 '22 14:09

Sammaye