Last Updated: October 07, 2020
·
2.106K
· frank-dspeed

RUN NODE JS Directly INSIDE the JavaVM

Node.js arrives for the JVM

Nodyn for Node.js enables Nodeapps to work directly with existing Java apps

"JavaScript everywhere, and everything ported to JavaScript" -- it's either a running joke in IT these days or a stone-cold truth. Evidence is tending toward the latter, what with Node.js becoming a jack-of-all-trades framework for many workloads and environments.

With Nodyn, Node.js gains yet another place it can run: the Java Virtual Machine.

Nodyn, a project sponsored by Red Hat via its Project:Odd team, works by leveraging two other projects: the DynJS project, which provides the actual JavaScript runtime (ECMAScript, actually) for the JVM, and the Vert.x application platform/event bus system.

But the main motive for allowing Node.js apps run on the JVM is about allowing Node.js Applications to work directly with existing Java Applications. Consequently, the Nodyn project is also part of the JBoss ecosystem for the sake of further integration with the rest of the Java application world, as well as apps from any other language currently running on the JVM (such as, Clojure).

Nodyn isn't a direct port of the Node.js code. It replicates the functionality of Node.js's APIs. Not working things like the VM API (itself unstable in Node.js) and TLS/SSL haven't been implemented yet.

Alternates for Nodyn to make Node.js talk to other platforms is native Node and node-ffi -- short for "Foreign Function Interface" -- which allows Node.js to create bindings with dynamic libraries without needing any C++ code on the part of the Node.js programmer. It isn't clear yet how node-ffi's performance will stack up against Nodyn in the long run, although Nodyn seems like it's aiming to be the far more complete, robust solution of the two, thanks to such features as the clustering capabilities inherent in Vert.x.

I Use it in Production on some Price Comparing engines that are Running Apache Solr ( lucene search ) and even for Processing big Data Hadoop on more then 200 servers at the same time i make the complet Orchestration with it and stream the results out. That allows Adjust of big unstructured Search Methods!