Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why not mongodb?

Tags:

mongodb

I recently used MongoDB for the first time and found it exceptionally easy to use and high-performing. Which leads to my question - why not MongoDB?

Lets say I am implementing a Q & A app. My approach would be to implement the User data in a MySQL database and then use MongoDB for the question and answer storage - one collection storing a question and all responses.

Is there anything wrong with this approach?

like image 515
christophmccann Avatar asked Nov 26 '10 21:11

christophmccann


People also ask

What are disadvantages of MongoDB?

Cons: Data size in MongoDB is typically higher due to e.g. each document has field names stored it. less flexibity with querying (e.g. no JOINs) no support for transactions - certain atomic operations are supported, at a single document level.

Should you use MongoDB?

NoSQL databases like MongoDB are a good choice when your data is document-centric and doesn't fit well into the schema of a relational database, when you need to accommodate massive scale, when you are rapidly prototyping, and a few other use cases.

Why MongoDB why not MySQL?

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 still popular?

MongoDB has become quite popular in the last few years with the number of users growing at almost the same rate as PostgreSQL. For a very different kind of database application, of course.


1 Answers

MongoDB sounds like a fine application for your problem, but there are plenty of reasons why you would not use it.

MongoDB would not be well suited for applications that need:

  1. Multi-Object Transactions: MongoDB only supports ACID transactions for a single document.
  2. SQL: SQL is well-known and a lot of people know how to write very complex queries to do lots of things. This knowledge is transferrable across a lot of implementations where MongoDB's queries language are specific to it.
  3. Strong ACID guarantees: MongoDB allows for things like inconsistent reads which is fine in some applications, but not in all.
  4. Traditional BI: A lot of very powerful tools exist that allow for OLAP and other strong BI applications and those run against traditional SQL database.
like image 60
geofflane Avatar answered Oct 04 '22 05:10

geofflane