While many companies are still thinking about a migration to a microservice architecture, many didn’t hear about Elixir/Erlang yet. It seems weird to me, because Erlang solved a lot of scalability headache before the microservice concept was named; even before the release of Java 1.0.

The purpose of microservices

To be as brief as possible, microservices architecture help in these cases:

  • allow a service to be able to scale: monolithic apps can be hard to scale
  • functional split of the service: teams could have a much adapted code source organization in the case of their project
  • language/tool agnostic solution: you can choose the more suitable tool to solve a specific problem

Despite of this nice characteristics, this is a very expensive architecture (in time, context switching and team skills). If you think costs will just double, I seriously think you are so far from the truth.

A common advice is to start small and simple, so microservices is rarely the best option at the birth of a project.

The case of Elixir

Elixir is welcomed in a microservices architecture, as every other languages. This is one of the purpose of this architecture which enable the “good tool for the right job” spirit. But, that is not my point here.

Technical complexity

One of the killer feature of Elixir is the use of the BEAM (a.k.a. the Erlang VM) under the wood. The BEAM allow you to write an app as a monolith and run it “as microservices” on the host machine; i.e. each operation runs in a single lightweight process (a bit like in a function as a service set-up). Moreover, multiple BEAM could work together on different machines, even at the other side of the earth through the internet!

This is often the main argument in favor of a microservices architecture. Nevertheless, Elixir (in fact, the BEAM) solved a lot technical problem of scalability a long time ago.

Functional split

The functional split of a project is doable with the concept of Umbrella. It adds a dependency management, but no comparison with microservices complexity.

Language agnostic?

This is the point where Elixir can’t help you. If some tools like Rustler are fantastic to add Rust code in your project, microservices is the architecture of choice for a language agnostic solutions.

In short

Elixir/Erlang can avoid you the complexity of a microservices architecture. If you start a project, choosing it allow you to build a monolith without the need to rebuild everything as microservices in the future. If you feel the need of a functional splitting of the source code, Umbrella come to the rescue. If Elixir does not seem to feet your requirements, feel free to think about a microservices architecture, but start simple as possible (probably with a monolith).

A good real life example is a little service called WhatsApp, who manage a billion users with only 55 engineers. To name some others: Discord, Pinterest, Riot Games.

It scales, period.