[CONJS-169] Support failover and/or high-availability/load-balancing from Node.JS connector Created: 2021-06-14  Updated: 2021-09-15  Resolved: 2021-09-15

Status: Closed
Project: MariaDB Connector/node.js
Component/s: configuration
Affects Version/s: None
Fix Version/s: N/A

Type: New Feature Priority: Major
Reporter: Rob Schwyzer Assignee: Diego Dupin
Resolution: Incomplete Votes: 0
Labels: None

Issue Links:
Relates
relates to CONC-365 Failover capabilities Closed
relates to CONCPP-4 Failover capabilities for Connector/C++ Closed

 Description   

Due to recent changes in MaxScale v2.5, the connector must provide failover functionality rather than Keepalived/F5/etc. See rationale for why MXS-3591 was refused.

Until a customer can specify multiple endpoints for a connection via Connector/node.js, there is no supported mechanism for customers to leverage Cooperative Monitoring while using Connector/node.js.

Note that Connector/J provides a robust feature set which could make sense to copy or draw inspiration from-
https://mariadb.com/kb/en/failover-and-high-availability-with-mariadb-connector-j/



 Comments   
Comment by Diego Dupin [ 2021-06-15 ]

There is already some multiple host functionality: see https://github.com/mariadb-corporation/mariadb-connector-nodejs/blob/master/documentation/promise-api.md#pool-cluster-api

example :

const mariadb = require('mariadb');
const cluster = mariadb.createPoolCluster();
cluster.add("maxscale1", { host: 'MXS1', user: 'myUser', connectionLimit: 5 });
cluster.add("maxscale2", { host: 'MXS2', user: 'myUser', connectionLimit: 5 });
 
const conn = await cluster.getConnection("*");
const res = await conn.query('SELECT * FROM myTable');
conn.release();

This permit to use multiple maxscales, using the actives ones. Do you thing there is something else missing ?

Comment by Rob Schwyzer [ 2021-06-15 ]

I am very sorry, I missed this on first check. This looks great and should work very well! Thank you very much!

Comment by Diego Dupin [ 2021-09-15 ]

rob.schwyzer@mariadb.com closing it now, please create a new task / reopen this if thinking there is still something missing

Generated at Thu Feb 08 03:23:15 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.