An Update on JavaScript and Oracle

An Update on JavaScript and Oracle

By February 29, 2016 Uncategorized

Today is a big day for JavaScript and Oracle for 2 reasons:

  1. The Oracle Database driver for Node.js has a new JavaScript layer
  2. Oracle JavaScript Extension Toolkit (JET) is now open source

When I took my job at Oracle as a JavaScript Developer Advocate, I didn’t know exactly what to expect. JavaScript in a database company, really? But as time went on the list of JavaScript based initiatives I stumbled upon just grew and grew. Now the problem is trying to keep up with them all!

In addition to the two announcements above, I want to share some of the initiatives that are currently on my radar to give you a better picture of what Oracle is up to in this area. It’s not a complete list as there are things I can’t talk about and probably more I don’t even know about, but I think each of these initiatives is pretty cool and has the potential to really empower enterprise JavaScript developers.

Node.js driver for Oracle Database

This is the driver that allows folks using Node.js to tap into Oracle Database – a fun combination.

Since starting at Oracle, I’ve focused more on this project than any other. In fact, most of the posts in this blog involve this driver in one way or another.

Now the driver is sporting a new JavaScript layer! This new layer will allow JavaScript to be used over C where it’s more advantageous to do so. Additionally, the new layer will help make it easier for folks in the JavaScript community to contribute to the project without having to know C.

This first release of the JavaScript layer adds connection request queueing (no more ORA-24418: Cannot open further sessions!) and we have some pretty cool features planned for future releases.

Links:

Application Container Cloud

The Application Container Cloud is one of the newer services in Oracle Cloud. It provides the ability to provision both Java and Node.js based runtime application containers. The amount of RAM available to the containers can be scaled dynamically on demand. This service is a welcome addition to Oracle Cloud and I look forward to seeing how it develops over time.

Links:

JSON in Oracle Database

JSON, the data interchange format originating from JavaScript, has proven its worth and is here to stay for certain workloads. As a result, a number of new conditions (IS [NOT] JSON) and functions (JSON_VALUE, JSON_QUERY, JSON_TEXTCONTAINS, and JSON_TABLE) have been added to Oracle Database (12.1.0.2) to support JSON in the SQL engine.

The conditions allow users to ensure that data going into a column is valid JSON (strict or lax) and the functions allow data to be parsed out using JSON path expressions.

My favorite of the new functions is JSON_TABLE, which can be used to create relational style views on top of JSON data. This allows people that know SQL to leverage their existing knowledge with JSON data. Additionally, it allows various tools that require SQL and relational constructs to keep working as they always have regardless of how the data is stored.

Links:

Nashorn

Nashorn is a JavaScript engine that runs inside the Java Virtual Machine (JVM). It’s a bit inceptiony at first glance but this kind of technology can really open up some unique possibilities (see SQLcl below). Actually, JavaScript is only one of many languages implemented in the JVM.

Links:

Graal, Truffle, & Graal.js

Okay, with these technologies we’re entering the research realm of the Oracle Labs group. Graal is a new just-in-time compiler for the JVM, Truffle is an API in Graal that scripting language interpreters can use to emit native code, and Graal.js is one such interpreter that uses Truffle to implement a JavaScript compiler/runtime that’s capable of running Node.js applications on the JVM. I’m still trying to wrap my head around all of that! 🙂

If Graal.js sounds a bit like Nashorn it’s because there are some similarities. What makes this stack different is the use of the Truffle API, which aims to bring the performance of Java to a variety of languages including JavaScript, R, Ruby, and more. This is all very experimental still, but if it sounds like something you’d be interested in learning more about, checkout the link below and note that there is a binary download you can use today to start experimenting with these technologies.

Links:

SQLcl

SQLcl can be though of as a modern version of SQL*Plus, the command line interface for Oracle Database. Not to take anything away from SQL*Plus, it’s the go to choice for most Oracle DBAs for good reason, but many developers have been looking for a similar tool with more modern features that enhance their development workflow. This is that tool.

SQLcl is written in Java and is based on some of the code in SQL Developer that was added to support SQL*Plus code. So despite the fact that SQLcl is currently only available as an Early Adopter release, it’s actually quite stable and robust.

Why is a command line interface to the database included in a list of JavaScript initiatives? Well, SQLcl runs Nashorn internally which allows it to run JavaScript (among other scripting languages). This means that JavaScript developers can leverage their knowledge to write scripts that query and manipulate the database and then run them through SQLcl.

Links:

JET

JET, short for the JavaScript Extension Toolkit, is a collection of open source JavaScript libraries (Knockout, Require, jQuery, etc.) combined with a number of Oracle contributed, open source JavaScript libraries that is used to create client-side applications.

What makes JET standout is its rich set of UI components, which include a number of data visualizations (charts, maps, etc.) that are fully responsive. JET is built for use in enterprises and includes built-in support for accessibility and internationalization. Because JET takes a modular approach, developers are able to swap out various pieces of the toolkit to better suit their needs.

Links:

NetBeans

Last, but not least, is the free NetBeans IDE. NetBeans has been around a long time but I hadn’t really heard of it prior to taking this job. After learning about the JavaScript enhancements that were part of the 8.1 release late last year, I decided to try it. Some of the highlights of that release include: support for Node.js (including debugging), Gulp, Mocha & Selenium, Jade, Shadow DOM (via NetBeans plugin for Chrome), AngularJS, KnockoutJS, and more!

Now NetBeans is my primary JavaScript IDE. I still have a lot to learn, but I’ve been enjoying it so far.

Links:

That’s it for now. I hope to bring you more content on these and other exciting JavaScript based initiatives in Oracle soon!

2 Comments

  • Aldo says:

    I’ve been reading all your posts about node.js and
    Oracle… Its mesmerizing, its almost 1 am here (Panama) and I just need to learn MORE!

    Looking forward to create some stuff using node and apex.

    Great Job and thank you!

Leave a Reply