Search code examples
mysqlnode.jsrelational-databasemysql2

What is the difference between MySQL & MySQL2 considering NodeJS


I have read the following:

What the difference between mysql and mysql2 gem

So far I have only used MongoDB with NodeJS and I want to be able to learn MySQL for any of my relational database needs. While researching MySQL & NodeJS I have found repositories for MySQL2 and it has nothing related to the MySQL website. I'm guessing that there have been API's created that make it faster for developing with languages like NodeJS & Ruby. From a NodeJS standpoint, I'm guessing that I still run the regular MySQL database on my server, but I need to interact with it using these new API's. Like:

https://github.com/sidorares/node-mysql2/blob/master/README.md

I have seen a site where they do performance benchmarks and NodeJS & MySQL come in very low for performance and NodeJS & MySQL2 very high.

Source for this info: php-nodejs-mysql-and-mongo

Image from that post:

enter image description here

Do I simply use the regular MySQL database on my server and use this mysql2 API or is there a different implementation of MySQL that works with this API?


Solution

  • This is just 2 different APIs written by regular people. Difference is in syntax of commands and maybe in performance, just install both, make your own tests for your goals and choose one you think is more suitable for you.

    Here is a comparison by NPMCompare: