What’s new in MariaDB Connector/Node.js 3.3


We are pleased to announce the general availability (GA) of MariaDB Connector/Node.js 3.3. MariaDB Connector/Node.js 3.3 is the newest version of our interface for building Node.js applications on top of MariaDB Community Server and MariaDB Enterprise Server.

The MariaDB Connector/Node.js 3.3 release series is replacing the maintenance releases for the 3.2 release series, as the new release series is fully compatible with 3.2.

MariaDB Connector/Node.js 3.3 includes the following enhancements:

  • Zero-Configuration SSL Encryption
  • Faster Prepared Statement Handling using Pipelining

Zero-Configuration SSL Encryption

Using SSL (a more correct term would be TLS, but in reality SSL is more commonly used) has been simplified with MariaDB Server 11.4. Before version 11.4, proper SSL configuration required multiple manual steps for the server and all the clients connecting to it.

For MariaDB Connector/Node.js 3.2 to establish an SSL encrypted connection, or a MariaDB Server release series previous to 11.4, three options can be used:

  • Have server certificates generated withtrusted node.js Certificate Authorities (CA), using a configuration like:
    ssl: true
  • Configure the connector using a server certificate, like:
    ssl: {  ca: [ fs.readFileSync('server-cert.pem') ] }
  • Disable the verification of the SSL certificate, which is insecure and not recommended, using a configuration like:
    ssl: { rejectUnauthorized: true }

For MariaDB Connector/Node.js 3.3 to establish an SSL encrypted connection to MariaDB Server 11.4, enabling SSL does not require any special configuration apart from using ssl: true. The connector doesn’t need to know the server certificate anymore, as long as the password is not empty.

Faster Prepared Statement Handling using Pipelining

Before MariaDB Connector/Node.js 3.3 connection.execute was first executing a PREPARE command, reading the PREPARE response, executing the EXECUTE command, and finally reading the EXECUTE response.

The new implementation, when using MariaDB Server 10.2+ and with the `pipelining` option enabled (default value), is to execute the PREPARE and the EXECUTE command, then to read the responses of PREPARE and EXECUTE. This new processing is reducing the network latency.

Benchmarking results of the new connector release comparing pipelining disabled and enabled (using a local database on a desktop computer. Therefore a remote database would have an even better result):

Connector/Node.js Prepare + Execute benchmarks without and with pipelining

This improvement results in less latency for the first execution of a specific prepared statement. The PREPARE is cached by default for a second execution.

See the release notes page for more details and visit mariadb.com/downloads/connectors/connectors-data-access/nodejs-connector/ to download.