Node JS - MongoDB x MySQL

1

Why every Node JS tutorial we see, is always shown example in MongoDB.

What do the two have that are so used?

Why not use MySQL with Node?

    
asked by anonymous 17.11.2016 / 22:29

1 answer

4

One reason why using Node.js with MongoDB is so common is why both deal with the same data structure natively.

Node.js is a server-side javascript execution environment. Javascript works fine with JSON (JavaScript Object Notation) and MongoDB is document oriented, which are similar to JSON objects.

  

A record in MongoDB is a document, which is a data structure   composed of field pairs and value. MongoDB documents are   similar to JSON objects. Field values can include   other documents, arrays, and document arrays.

That is, they both speak the same language. Another factor is that Node.js is very scalable and being asynchronous is being heavily used in real-time applications that combines the fact that MongoDB is a NoSQL where it is assumption of greater scalability with respect to relational databases.

So much is encouraged that there is MEAN (MongoDB, Express, Angular, Node.js), which provides structure to work with these technologies .

And yes, it is possible and also commonly used Node.js with MySQL , so much so that the ORM exists Sequelize .

How much to use one or the other depends on the need and requirements of the business.

    
18.11.2016 / 15:42