A Node.js MySQL driver branched from mysqljs/mysql (v2.7.9) to add clustering capabilities, allowing connection pooling across replicated masters and slaves with automatic failover and deadlock handling. It is pure JavaScript, MIT licensed, and targets Node >= 0.6. Unlike the original mysql package, it introduces PoolClusterFarm for multi-master and multi-slave replication management, scaling from 1 master to many. However, it is unmaintained since 2017 (last commit) and relies on outdated dependencies.
npm install mysql-clusterfarmNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates setting up a PoolClusterFarm with a master and slave, then executing a query.
Always use 'mysql-clusterfarm' in require/import statements, not 'mysql'.
Consider using mysql2 with connection pooling or a dedicated clustering library like 'mysql-replication'.
Review deadlock handling options in PoolClusterFarm and test under load.
Always provide a unique name as first argument to addMaster/addSlave.
npm install mysql-clusterfarm (may need to install mysql separately: npm install mysql)
const mysql = require('mysql-clusterfarm'); const poolClusterFarm = mysql.createPoolClusterFarm();Double-check user, password, and host in addMaster/addSlave options.