I have a computation library implemented with java/scala. And I also have a little of node.js code serving my application. I need to find a way how to connect this 2 worlds with maximum performance, but also simplicity in mind. I was thinking about inter process communication via shared memory, but don't find any mature way to do that in node.js
This should work mostly as a proxy mechanism to call some java (ideally any) code from node.js code. From node.js to java side it will be only request metadata passing, however from java to node.js sometime it could be significant data returned (let's say 100-200 kb as upper border, and around 600-1000 bytes in 90% of the cases) However amount of that's request could be significant.
Think OpenMP could be an option, but also can't find any openmp protocol implementation for Node. However there is also no clear project for java as well.
Looks like for the current moment there is several alternatives:
Speed of CodingNode. js is known for its flexibility and so, fast in development. Yet, Java is the exact opposite of Node. js since the first technology takes much more time to develop due to being a rigid language (though, Java may save time in the long term in some cases).
The virtual machine in Node. js (V8), which is responsible for executing JavaScript, is compiled using JIT. At runtime, the virtual machine can take the source code and compile it into machine code. This means that all frequently used “hot” functions can be compiled to machine code, which speeds up execution.
Combining Node and the JVM The Node. js core modules have also been compiled in. Running Node. js on the JVM provides an easy migration path for anyone with a large Java stack who wishes to start using Node.
Well, if sockets are too slow for you, why not keep it in-process?
You could try:
Note: An alternative to Nodyn/DynJS would have been the Avatar.js project, which uses Nashorn, which in turn is shipped with recent JVM's and uses the latest and greatest bytecode operators. However in late 2015 the Avatar.js project feels abandoned. :-\
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With