The leading edge of scripting languages and Oracle Database brought to you by the Data Access Development team

Node-oracledb 4.1 Oracle Database Sharding Support

Christopher Jones
Senior Principal Product Manager

Release announcement: A new release of node-oracledb, the Node.js module for accessing Oracle Database, is available from npm.

Top features: Oracle Sharding Support

See the CHANGELOG for all changes and bug fixes.


Significant changes in node-oracledb 4.1 are:

  • Support for Oracle Sharding.

    Sharding can be used to horizontally partition data across independent databases. A database table can be split so each shard contains a table with the same columns but a different subset of rows. These tables are known as sharded tables. Sharding is configured in Oracle Database, see the Oracle Sharding manual. Sharding requires Oracle Database and client libraries 12.2, or later.

    When opening a connection in node-oracledb 4.1, the new shardingKey and superShardingKey properties can be used to route the connection directly to a given shard. A sharding key is always required. A super sharding key is additionally required when using composite sharding, which is when data has been partitioned by a list or range (the super sharding key), and then further partitioned by a sharding key.

    When connected to a shard, queries only returns data from that shard. For queries that need to access data from multiple shards, connections can be established to the coordinator shard catalog database. In this case, no shard key or super shard key is used.

  • Support for the end-to-end tracing attributes connection.clientInfo and connection.dbOp. These additions to the tracing attributes will make it easier to monitor applications.

  • Reverted the default of oracledb.events back to false, to avoid a connection delay seen in some network configurations. You should set it explicitly, as needed.

One other note: if you are using queryStream() (even if you are not upgrading), check that you are waiting for the 'close' event before the connection is closed. Our previous example would lead to memory being allocated longer than needed, giving the appearance of a memory leak. For significant queries - just the kind you would use queryStream() for - the amount of memory could be large.

PS Node-oracledb users may be interested in my recent announcement Permanent URLs for the Latest Instant Client Packages.


Node-oracledb installation instructions are here.

Node-oracledb documentation is here.

Node-oracledb change log is here.

Issues and questions about node-oracledb can be posted on GitHub or Slack (link to join Slack).

Follow us on Twitter or Facebook.

Finally, contributions to node-oracledb are more than welcome, see CONTRIBUTING.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.