fastify / fastify-mysql

MIT License
66 stars 19 forks source link

Using the mariadb-connector-nodejs client instead of mysql2 #149

Open GiovanniSlabs opened 1 month ago

GiovanniSlabs commented 1 month ago

Prerequisites

🚀 Feature Proposal

I wanted to suggest using the mariadb-connector-nodejs client as it claims to offer much higher performance compared to mysql2. I have used it in several projects with excellent results. However, I have never conducted independent benchmarks on the two clients.

Motivation

The motivation is to make everything as fast as possible. Following the philosophy of Fastify

Example

No response

mcollina commented 1 month ago

I'm afraid it mighht be a bit of a breaking change, as I expect the two modules to have different APIs.

GiovanniSlabs commented 1 month ago

In this article (https://mariadb.com/resources/blog/which-node-js-connector-is-best-to-use/) where they do some benchmarking on the main MySQL clients for Node, they claim that mysql2 and mariadb share the same API as the mysql connector, which is why I suggested it.

gurgunday commented 2 weeks ago

They say the client implementations are compatible, I think this could be very cool area to explore — it's quite a bit more performant