What is the most mature/stable mysql node.js module

后端 未结 2 1048
独厮守ぢ
独厮守ぢ 2021-01-31 10:24

I am looking to do some work around mysql and node.js and have found a few different modules out there but I cannot get a good bead on their stability/maturity. I know each auth

相关标签:
2条回答
  • 2021-01-31 11:12

    I'm the author of node-mysql-native driver, from my point of view the differences are

    1. no prepared statements support (yet) in node-mysql
    2. according to my benchmarks node-mysql is 10-20% slower than node-mysql-native
    3. node-mysql has much wider adoption, more tests and users. If you need stability, better use it
    4. node-mysql-libmysqlclient is 2 to 3 times faster on fast queries. However, if you have a lot of slow queries and use connection pools it could be even slower than native JS driver because libmysqlclient async calls are based on nodejs thread pool and not on event loop.

    update

    As of 11/07/2013

    • (2). no longer valid (mysql-native is a bit slower than node-mysql)
    • have this alternative to node-mysql, on some benchmarks it's 2-3 times faster, has same API + support for prepared statements, SSL and compression. Also implements simple subset of server side protocol - see for example MySQL -> Postgres proxy.
    • node-mariasql is also a very good option (if it's ok to use binary addon) - fast, stable, async, prepared statements support, compression and SSL.
    0 讨论(0)
  • 2021-01-31 11:26

    I went through a similar search and ended up settling on node-mysql. I like it's simplicity, the fact that it's pure js, and that it's well supported. It was slower in tests that I did than some of the mixed modules (those that used non-js libs), but I did a minor patch that helped considerably with that for my cases:

    https://github.com/geochap/node-mysql

    0 讨论(0)
提交回复
热议问题