Clustering in Elixir 1.9 with Mix Releases and libcluster

We just published a guide to automatic clustering in Elixir 1.9, with Mix releases and libcluster.

The cluster automatically discovers nodes as they join or leave, allowing you to scale by simply increasing the number of instances for your app. The source code is available at GitHub - render-examples/elixir_cluster: Distributed Elixir Cluster on Render with libcluster and Mix Releases.

13 Likes

Would it be a bad idea to deploy your app as a distributed cluster even though you won’t have much traffic to begin with? I understand “premature optimization is the root of all evil” but is having your app configured for distributed deployment an optimization decision or a design decision?

I wonder because I have a project that uses ETS tables and currently doesn’t get much traffic. But if I ever needed to scale it, I imagine I would have to use something like Mnesia instead.

No, it becomes valuable as soon as you have >1 instances for high availability. For example Phoenix channel broadcast and Phoenix presence will use clustering
for communicating between nodes.

4 Likes