Elixir Development: Fault-Tolerant Services

We pick Elixir on the Erlang virtual machine for processes that must survive a neighbour's failure: request routers, streaming connections and caches.

The projects we write in Elixir

Projects from the portfolio and the case studies, each with a short note on what this language does in it.

When we choose it, and when we do not

Where we use it

  1. 01

    A command router on a node

    The Flaem router on every node holds the command stream from the core, the job queue and the reports. A slow Proxmox call runs in a separate task, so it does not block the rest of the node.

  2. 02

    Recovering from failure

    A supervisor from OTP (Erlang's toolkit for fault-tolerant services) restarts a process that crashed while the rest of the system keeps running. A closed stream to the core ends in a reconnect, not in a service failure.

  3. 03

    A report on what really runs

    When the core asks, the node lists the machines that exist in Proxmox and the game servers it hosts. An error while gathering ends in an error report, not in a stopped command stream.

  4. 04

    Local node state

    The node keeps its servers, assigned addresses, tunnels and SFTP credentials in SQLite through Ecto. A process restart does not lose what the node knows about itself.

  5. 05

    A Redis-compatible cache

    excache speaks the RESP protocol, so ordinary Redis clients connect to it. The keys are split between supervised processes, and each process handles its own keys in turn, with no locks.

  6. 06

    Every connection in its own process

    Erlang VM processes are light, so in excache every client connection gets its own. A stuck or dropped client does not block the others.

When we choose something else

  1. 01

    Interfaces and sites

    The Flaem panel is in React and TypeScript, while Elixir works on the nodes, where there is no screen at all. An interface in TypeScript is easier to hand to the next team.

  2. 02

    Heavy computation

    The Erlang virtual machine is built for input and output, not for number crunching. We write numeric computation and cryptography in Rust.

  3. 03

    An agent in a client's machine

    An Elixir release carries its own ERTS runtime. An agent inside a client's VPS should be one small binary, so we write it in Go.

  4. 04

    A billing core

    Elixir checks types mostly at run time, so a wrong shape of data shows up only when the code runs. Billing and KSeF (Poland's national e-invoicing system) in the Flaem core are in Rust, where the compiler checks them.

  5. 05

    A service for a team without Erlang

    There are fewer Elixir developers than Go or TypeScript ones. When the client's team will take the service over and supervision is not central, we pick Go.

  6. 06

    Scripts and automation

    A one-off script or a bot needs no supervisors and no releases. Python is on every Linux box and gets it done sooner.

Elixir or something else

A technology has to fit the place the code will run and the team that will take it over. The final choice is made in the quote, together with you.

Service Elixir Go
Thousands of connections and supervision built into OTP written by hand
A single binary a release with its own ERTS yes
Developer availability lower higher
One part failing the supervisor restarts just that part an unhandled panic ends the whole program
A hanging external call a separate process, the rest keeps answering a separate goroutine with a timeout
Types checked mostly at run time static, checked at compile time
Heavy computation a weak spot of the Erlang VM faster machine code

The libraries these projects stand on

From the dependency files of our repositories. With each, one sentence on what we use it for.

Frequently asked questions

Answers about Elixir and our projects.

How much does an Elixir service cost and how long does it take?
A service that sits between systems starts at PLN 999 (about EUR 220), while a platform with many concurrent connections starts at PLN 8,999 (about EUR 2,020) and usually takes 2-4 months. We give the figure for your scope in a free quote.
Is Elixir not too niche?
It is rarer than Go or TypeScript, so we use it only where OTP gives something other languages lack out of the box: process supervision and recovery from failure.
When Elixir and when Go?
Elixir when a service holds thousands of connections and has to recover from failure by itself: process supervision is built into OTP. Go when you need one small binary, heavy computation or developers who are easier to find.

Tell us what you want to build.

A free quote comes back within an hour during working hours. You talk to the person who writes the code.