Back at its OpenWorld event in 2014, Oracle announced it was working on a Node.js driver for its database products. The resulting code was released last week, as open source code with an Apache 2.0 license.
While the driver is currently a preview release for Unix servers, including Linux and Mac OS, it’s under active development and support for Windows is forthcoming (which should allow Azure Oracle instances to work with Azure Node.js servers). Other planned features include handling large query results by batch fetches or by streaming. Oracle’s Node.js support goes beyond on-premises Oracle deployments, and if you’re using Oracle’s Cloud service you’ll soon be able to use the Node.js driver in your applications, with self-service provisioning tools and support for common Node.js modules.
A native Oracle driver for Node.js makes a lot of sense, as it allows developers to quickly build scalable web front ends for Oracle applications. Using Node for small, fast, dedicated web switches simplifies application development, especially in conjunction with widely available Model View Controller frameworks — and where much of the code for an application can be built in the database using Oracle’s own development tools.
Setting up the driver is easy enough; start by downloading the source code from GitHub, and then set up Node.js in the same directory as the driver. The Oracle Node.js driver is installed as a Node.js module, and connection strings are set using a
getConnection statement in your code. Once connected to an Oracle database, the Node.js driver can be used to run SQL and PL/SQL commands. You can also call Node.js directly from Oracle’s APEX web application framework.
Along with delivering its driver, Oracle has also set up a Node.js Developer Center as part of its Oracle Technology Network community site. You’ll find user questions (and answers) as well as links to Oracle content. There’s already useful content, including code snippets, from developers working with the Node.js drivers, which should speed up initial deployments.
Oracle’s commitment to Node.js is welcome, offering developers the tools needed to build hybrid highly scalable web apps and services, where Node.js acts as an interface between the web and Oracle’s database tools.