Erlang / Erlang Basics Interview questions
How does distributed Erlang handle node failures?
Distributed Erlang connects multiple BEAM nodes into a cluster where PIDs, links, and monitors all work transparently across node boundaries — sending to a remote PID looks identical to sending locally. Node health is tracked through a mesh of TCP connections, each node maintaining a heartbeat with the others.
sequenceDiagram
participant A as Node A
participant B as Node B
A->>B: monitor_node(B, true)
Note over A,B: Heartbeat over TCP
B--xA: Connection lost / node down
A->>A: receives {nodedown, 'B@host'}
When a remote node becomes unreachable (crash, network partition, or explicit shutdown), any local process
that called monitor_node/2 on it receives a {nodedown, Node} message, and any
processes linked to PIDs on that node get exit signals just as if those remote processes had crashed locally
— the same link/monitor semantics that work within one node extend across the cluster.
Because Erlang can't distinguish "the remote node crashed" from "the network partitioned," distributed systems built on it still need an explicit strategy (e.g. quorum-based tools, or accepting eventual reconciliation) for split-brain scenarios — the platform gives you the failure notification, not a built-in resolution to network partitions.
More Related questions...