Elixir
01 / 02

BEAM Processes, Fault Tolerance & Supervision

BEAM Processes, Fault Tolerance & Supervision

Built on Erlang's Battle-Tested VM

Elixir is a functional, dynamically-typed language that runs on the BEAM — Erlang's virtual machine, originally built for telecom systems requiring extreme uptime. By targeting BEAM, Elixir inherits its lightweight process concurrency and fault-tolerance mechanisms rather than reimplementing them.

Lightweight Processes & Message Passing

A BEAM process is a VM-managed (not OS-managed) unit of concurrency with its own memory and mailbox — a few KB each, cheap enough that applications routinely spawn hundreds of thousands or millions of them. Processes don't share memory; they communicate exclusively via asynchronous message passing, avoiding the race conditions and deadlocks common to thread-based shared-memory models.

"Let It Crash" & Supervisors

defmodule MyApp.Supervisor do
  use Supervisor

  def init(_arg) do
    children = [
      {MyApp.Worker, []}
    ]
    Supervisor.init(children, strategy: :one_for_one)
  end
end

Rather than defensively coding around every possible error, a process is allowed to crash on unexpected state — a Supervisor detects the crash and restarts it in a known-good state, isolating the failure. Supervisors form a tree, each watching its children (workers or other supervisors) and restarting them per a configured strategy — the operational backbone of Elixir's fault tolerance.

GenServer

GenServer is an OTP behavior providing a standardized pattern for a stateful server process — handling synchronous calls, asynchronous casts, and internal state — without hand-rolling the underlying message-handling boilerplate every time.

Keep your own version of these notes — editable, searchable, and organised by your stack.

Start free