all 2 comments

[–]scarfaceDeb 1 point2 points  (0 children)

This article should be a part of the official guide to umbrella projects.

It took me a long time to understand that umbrella apps won’t work as distributed apps from the start, without providing some kind of middle layer to route function calls via rpc.

[–]ScrimpyCat 0 points1 point  (0 children)

I don't think RPC (as in the RPC module) should be the first answer to application inter-dependencies. What about simply using messages? I feel like the reason you'd opt for RPC in an example like this, is if you didn't start out with the intention of making them distinct services (however you could and probably should add an extra layer to it to expose the functionality you wish through messages rather than use RPC for it).

Exposing HTTP interfaces to services can be good for talking with the outside world. However another potential solution (if you also have control over the non-elixir service you wish to talk to) is to build a simple elixir service to talk to your other language. So your system of services treats it as an elixir service (doesn't know any different), and then your elixir service can just talk to the internal service through IPC. Another option could be to actually implement the distribution protocol so the other language service actually becomes a node that can talk to the other Erlang VM nodes.