I have a calculation library implemented using java / scala. And I also have some node.js code serving my application. I need to find a way to connect these two worlds with maximum performance, but also simplicity. I thought about the interaction between processes through shared memory, but did not find a mature way to do this in node.js
This should work mainly as a proxy mechanism for calling some java code (ideally any) from node.js. From node.js to the java side, this will only be the transfer of request metadata, however, from java to node.js, a significant amount of data can sometimes be obtained (say, 100-200 kb as the upper bound and about 600-1000 bytes in 90% of cases). However, the volume of this request may be significant.
Think that OpenMP may be an option, but also cannot find an implementation of the openmp protocol for node. However, there is also no clear design for java.
It seems that at the moment there are several alternatives:
- The internal Java + Unsafe extension (currently extracted via reflection, must be open in JDK 9) and the use of shared memory in a C / C ++ -based environment (research and development required. Exceptions for Node -> c -> Java may be higher than benefits shared memory)
- Use a socket (pretty fast on Linux, not sure about Windows cross-platform)
- FastCGI (still uses sockets that go inside, so it will be slower than option 1)
- ZeroMQ / Nanomessage as a transport layer (again a socket inside, but simplified development)
- @ David answer. However, I can not say anything specific about this. Investigation required.
source share