BEAM's Four Core Process Restart Strategies

BEAM's supervision trees utilize four primary restart strategies—`one_for_one`, `one_for_all`, `rest_for_one`, and `simple_one_for_one`—to automatically manage and recover from process failures, ensuring system stability.

The top 3

  1. One-for-One: BEAM's Independent Process Savior: The default `one_for_one` strategy restarts only the failed child process, ensuring other independent components remain unaffected and maintaining overall system uptime. This is ideal when processes can function autonomously without relying on the state of their siblings.
  2. One-for-All: Total System Reset for Interdependence: When one child fails, the `one_for_all` strategy terminates and restarts all siblings within its supervision scope. This drastic approach is crucial for tightly coupled systems where a single process failure could corrupt the shared state of other interdependent components.
  3. Rest-for-One: Recovering Dependent Sequences: This strategy restarts the failed process and all subsequent processes in the start order, ensuring consistency in systems where processes have sequential dependencies.

Sources

Open the full topic