# Communication between Elixir/Erlang services

**URL:** <https://forum.elixirforum.com/t/communication-between-elixir-erlang-services/22585>\
**Category:** Questions\
**Tags:** erlang, cluster\
**Created:** [May 21, 2019, 8:07pm UTC](https://forum.elixirforum.com/t/communication-between-elixir-erlang-services/22585 "2019-05-21T20:07:35Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![lpil](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lpil/32/17492_2.png) [@lpil](https://forum.elixirforum.com/u/lpil)\
**Post date:** [May 21, 2019, 8:40pm UTC](https://forum.elixirforum.com/t/communication-between-elixir-erlang-services/22585/3 "2019-05-21T20:40:17Z")

</div>

Hello! Welcome to the forum 🙂

> [@bsilva](#):
>
> Would be ok to add both of them into the same cluster?

It’s perfectly valid to create a cluster containing nodes with different code loaded on it if you wish. 🙂

> [@bsilva](#):
>
> 2 - Could I replace completely the communication between then that happened via http with Erlang messages?

Yes, this is definitely an option. If you are happy to always use Erlang based languages then a message based API can work well.

At very high throughput you may want to move from the default single TCP connection for inter-node messages to multiple connections. Depending on the skill-set and knowledge of your team is may be harder to implement than more mainstream HTTP APIs (but you’ll have had to implement much less API boilerplate up until this point).

> [@bsilva](#):
>
> 2.1 - If yes, how would it be possible? Is [rpc](http://erlang.org/doc/man/rpc.html) suitable for this?

I would advise against using the rpc module much, it uses a single gen server per node and this creates a big bottleneck. Your API should be regular messages sent to named processes.

> [@bsilva](#):
>
> 2.2 - How would load balancing work on that scenario? Should I write it or is it transparent?

You will need to implement load balancing for your message based API. There may be libraries that provide this sort of functionality, depending on what you want to do.

---

_[View the full topic](https://forum.elixirforum.com/t/communication-between-elixir-erlang-services/22585)._
