Would it be possible to have the Elixir/Erlang distribution working over websockets?

I have stumbled accidentally in this repo:

So, this left me wondering if the approach taken by @ityonemo to securely extend a Phoenix PuBSub over SSL with websockets couldn’t be used for the Erlang distribution mechanism itself?

For what I understand the current Erlang distribution has a bottleneck in the number of nodes that can be connected together due to the accumulation of all the requests for the gossip protocol and application data through the network, and this without using TLS.

When using TLS it becomes even slower due to the additional back and forth needed for the handshakes.

So, once websockets only need to do the handshake when establishing the connection I was wondering if using them would not increase throughput and the number of nodes that could be connected together?

Note: I know that is possible to overcome current limitations with specialized approaches, like for example the one described in this talk by a network engineer at Whats App.

I think the general problem is that erlang is using the gossip protocol as a way of achieving consensus for a lot of things like the :global locks. Also Pids are an overlay addressing system, so achieving consistency on that might be challenging, and maybe also causal ordering, for something based on PubSub messaging. Does erlang distribution over TLS not use persistently open connections? I imagine it does, because I think erlang distribution over TCP does.

You may also be interested in the partisan project which I think does more directly address these issues: https://www.youtube.com/watch?v=KrwhOkiifQ8

and (self-promotion) if you like pony_express you might also like the erps package :wink:


I have no idea, because I am still a beginner in the Elixir/Erlang world, despite the time I am playing with it I never used it in production. We will need to wait for somebody else to confirm your assumption :wink:

I already saw that talk in the last year and is contagious the enthusiasm of the presenter. Anyway thanks for remembering me of it.

Nice to know about it, and I would place the intro from this page into the intro for the current landing page.

I was about to close the browser tab when I finally found an explanation for what the package was for :wink:

1 Like