Open aschrijver opened 7 years ago
It isn't a combination that we officially support, nor have we heard of anyone else doing, so I'm afraid you will have to try for yourself.
One thing that concerns me a little is that if you run both Realm Java and Realm JS they will both try to load some of the same native code. This might or might not work. If you run them in different processes, then loading the native code shouldn't be an issue.
Unfortunately Realm Java is not fully process safe yet, and you might run into schema issues if you load the same Realm file in Java and Node in two different processes.
Thanks @cmelchior good points!
I expect this node-on-android use case to become more common as mobile devices get more powerful. I know of a number of people planning implementations.
The sharing of native code is something to avoid. An alternative in this design would be to have only a single realm package, either realm-js in RN or node, or a single realm-java bridging to both node and RN (where the bridges are also java).
I know this is a peculiar use case, but to a Realm expert what would seem the best choice in this? Personally I incline to realm-java as it provides the most stable foundation for the DB layer, I would think.
Some needed things for support realm-java and realm-js in one apk
SharedGroupOptions::set_sys_tmp_dir()
for both which is needed to make notification across both to work.
I am investigating viable options for running NodeJS on Android and then combining React Native and NodeJS in single fat client Android app using Realm DB. The node side of the application is involved in complex decentralized P2P networking (the rationale for having node on android).
I know Realm supports NodeJS on a server, but does it also run the node version on an android device?
Background info
I am musing on a CQRS-style design that does not need node realm support currently:
Application UI (react):
Background Service (node):
node_modules
space (even though node app will be bundled)DB
I thought this was a feasible design, but if there is no great overhead or large benefit to having realm-js on the node side I'd be glad to hear.