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

后端 未结 2 1054
独厮守ぢ
独厮守ぢ 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.

提交回复
热议问题