Which database should I use, MongoDB or MySQL?

If the question is between using a&nbsp;<a href="https://en.wikipedia.org/wiki/Document-oriented_database" target="_blank">Document</a>&nbsp;database versus a&nbsp;<a href="https://en.wikipedia.org/wiki/Relational_model" target="_blank">Relational</a>database, it ultimately boils down to a few simple questions about your data.

If the question is between using a Document database versus a Relationaldatabase, it ultimately boils down to a few simple questions about your data.

  • Do you have data that has a small number of searchable keys, but otherwise you anticipate little or no requirements to search your data by arbitrary criteria?
  • How structured is your data? Is your data basically tabular - would it fit nicely in spreadsheet-style rows and columns - or is it more like somewhat similarly-formatted files that can be expressed using JSONformat?
  • Do you have a lot of relationships between data elements, and do these relationships change often? Referential integrity.
  • Do you need to make sure that data and relationships between data become visible “all at once”? This requirement is very common in financial data, but is also common in many other applications. Support for ACID transactions and multi-statement transactions enables this requirement.
  • Can you afford to lose some currently-processed data and relationships between data if your database crashes? This is also a feature of database transactions and crash recovery.
  • What type of skillsets do most of your developers have?

Even if you have a requirement that some data is tabular and other data is more “file-structured”, you can still use something like MySQL or PostgreSQL, as they both support JSON documents of the sort you’d store in MongoDB as well as more traditional row-and-column data of the sort you’d have in a relational database: MySQL JSON supportPostgreSQL JSON support.

My own opinion is that the “default” go-to datastore in most situations is a relational database, unless you have a whole lot of data that is amenable to being stored in JSON documents as well as being looked up by a relatively small number of fixed criteria. By “a whole lot of data”, I mean enough that you need a large number of modern machines to handle it.

We have about 20 terabytes of “payload” (non-replicated) data in my current work environment, and we use MySQL on multiple machines to manage it. (With replicants it probably goes up to about 80TB or so.) The data is basically tabular data.

Learn MongoDB - MongoDB Tutorial for Beginners - Getting Started with MongoDB - Part 3/3

Learn MongoDB - MongoDB Tutorial for Beginners - Getting Started with MongoDB

What you’ll learn

  • Work with MongoDB with Clarity and Confidence
  • Use 4 tools MongoCHEF, NOSQL Manager, RoboMongo, MongoBooster easily
  • Do Regex, GridFS , Replication , Sharding, Full text search
  • Basic and Advanced CRUD operations using MongoDB
  • Import and Export data from MongoDB
  • Work MapReduce, Embedded Documents,Save&Insert , indexing, capped collections, TTL
  • Bonus section * Use java,C#,PHP,Nodejs to access MongoDB features like CRUD, GridFS
  • Bonus Section * A 50 minutes MongoDB key feature exercises
  • 100+ Quizzes 40+ Activities

Learn More

MongoDB - The Complete Developer’s Guide

The Complete Developers Guide to MongoDB

MongoDB - The Complete Developer’s Guide

Learn MongoDB : Leading NoSQL Database from scratch

Learn NoSQL Databases - Complete MongoDB Bootcamp 2019

Build a CRUD Operation using PHP & MongoBD

MongoDB with Python Crash Course - Tutorial for Beginners

Learn NoSQL Databases from Scratch - Complete MongoDB Bootcamp 2019

AngularJS tutorial for beginners with NodeJS, ExpressJS and MongoDB

MEAN Stack Tutorial MongoDB, ExpressJS, AngularJS and NodeJS

Creating RESTful APIs with NodeJS and MongoDB Tutorial

Learn MongoDB - MongoDB Tutorial for Beginners - Getting Started with MongoDB - Part 1/3

Learn MongoDB - MongoDB Tutorial for Beginners - Getting Started with MongoDB

What you’ll learn

  • Work with MongoDB with Clarity and Confidence
  • Use 4 tools MongoCHEF, NOSQL Manager, RoboMongo, MongoBooster easily
  • Do Regex, GridFS , Replication , Sharding, Full text search
  • Basic and Advanced CRUD operations using MongoDB
  • Import and Export data from MongoDB
  • Work MapReduce, Embedded Documents,Save&Insert , indexing, capped collections, TTL
  • Bonus section * Use java,C#,PHP,Nodejs to access MongoDB features like CRUD, GridFS
  • Bonus Section * A 50 minutes MongoDB key feature exercises
  • 100+ Quizzes 40+ Activities


Learn More

MongoDB - The Complete Developer’s Guide

The Complete Developers Guide to MongoDB

MongoDB - The Complete Developer’s Guide

Building A REST API With MongoDB, Mongoose, And Node.js

Node.js, ExpressJs, MongoDB and Vue.js (MEVN Stack) Application Tutorial

MEAN Stack Tutorial MongoDB, ExpressJS, AngularJS and NodeJS

MongoDB with Python Crash Course - Tutorial for Beginners

Learn MongoDB - MongoDB Tutorial for Beginners - Getting Started with MongoDB - Part 2/3

Learn MongoDB - MongoDB Tutorial for Beginners - Getting Started with MongoDB


What you’ll learn

  • Work with MongoDB with Clarity and Confidence
  • Use 4 tools MongoCHEF, NOSQL Manager, RoboMongo, MongoBooster easily
  • Do Regex, GridFS , Replication , Sharding, Full text search
  • Basic and Advanced CRUD operations using MongoDB
  • Import and Export data from MongoDB
  • Work MapReduce, Embedded Documents,Save&Insert , indexing, capped collections, TTL
  • Bonus section * Use java,C#,PHP,Nodejs to access MongoDB features like CRUD, GridFS
  • Bonus Section * A 50 minutes MongoDB key feature exercises
  • 100+ Quizzes 40+ Activities

Learn More

MongoDB - The Complete Developer’s Guide

The Complete Developers Guide to MongoDB

MongoDB - The Complete Developer’s Guide

Learn MongoDB : Leading NoSQL Database from scratch

Learn NoSQL Databases - Complete MongoDB Bootcamp 2019

Why We Moved From NoSQL MongoDB to PostgreSQL?

How to build GraphQL APIs with Kotlin, Spring Boot, and MongoDB?

Build a CRUD Operation using PHP & MongoBD

MongoDB with Python Crash Course - Tutorial for Beginners

Learn NoSQL Databases from Scratch - Complete MongoDB Bootcamp 2019