Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MongoDB vs MySQL

I used to build Ruby on Rails apps with MySQL.

MongoDB currently become more and more famous and I am now starting to give it a try.

The problem is, I don't know the underlying theory of how MongoDB is working (am using mongoid gem if it matter)

So I would like to have a comparison on the performance between using MySQL+ActiveRecord and model generated by mongoid gem, could anyone help me to figure it out?

like image 845
PeterWong Avatar asked Dec 15 '10 08:12

PeterWong


People also ask

Which is better MySQL or MongoDB?

MySQL is an excellent choice if you have structured data and need a traditional relational database. MongoDB is well-suited for real-time analytics, content management, the Internet of Things, mobile, and other types of applications.

Is MongoDB easier than MySQL?

MySQL flexibility. This is an easy one, and a hands-down win for MongoDB. The schemaless design of MongoDB documents makes it extremely easy to build and enhance applications over time, without needing to run complex and expensive schema migration processes as you would with a relational database.

Can MongoDB replace MySQL?

MySQL, MS SQL Oracle and Server are nearly synonymous with RDBMS, but MongoDB is a cross-platform document-oriented and NoSQL database. At times, it can be a wise decision to replace MySQL with MongoDB. It is a nimble database that allows fast changes of cognitive framework when apps evolve.


2 Answers

The article entitled: What the heck are you actually using NoSQL for? does a very good job at presenting the pros and cons of using NoSQL.

Edit: Also read http://blog.fatalmind.com/2011/05/13/choosing-nosql-for-the-right-reason/ blog post too

Re-edit: I found some recent material (published in 2014) on this topic that I consider to be relevant: What’s left of NoSQL?

like image 195
cristian Avatar answered Sep 24 '22 10:09

cristian


I don't know much of the underlying theory. But this is the advice I got: only use MongoDB if you run it across multiple servers; that's when it'll shine. As far as I understand, the NoSQL movement appeared in no small part due to the pain of load-balancing relational databases across multiple servers. So if you're hosting your application on no more than one server, MySQL would be the preferred choice.

The good people over at the Doctrine project recently wrote a quite useful blog post on the subject.

like image 35
Henrik Avatar answered Sep 21 '22 10:09

Henrik