Supervisors
- Supervisors. A Supervisor starts, watches and restarts children: failure handling as structure.
- Child specs. Children declare specs: start function, restart policy, shutdown: supervision as data.
- Strategies. one_for_one restarts the crashed child alone; rest_for_one and one_for_all share more fate.
Supervision Trees
- The tree. Supervisors supervise supervisors: the tree maps the application’s failure domains.
- Design question. Tree design asks: when this dies, what must die with it: and what must survive?
- Restart intensity. Trees bound restarts per window: a storm escalates upward instead of looping forever.
Fault-Tolerant Applications
- Application module. An Application module starts the root tree: the node as declared structure.
- Let it crash, still. Elixir keeps the philosophy: crash clean, restart fresh: defensive try/rescue stays rare.
- Error kernel. The tree protects a small kernel of critical state: everything else is safely restartable.
Before and after this level
- Before: Level 7: GenServer: Stateful Processes, Calls and Casts, Designing Reliable Servers.
- Next: Level 9: Mix & Hex: Projects, Dependencies, Packages and Libraries.
In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.
Frequently asked questions
What does Elixir Level 8: Supervision & OTP cover?
Supervisors, Supervision Trees, Fault-Tolerant Applications: 3 lessons and 9 ideas.
What should I know before this level?
The level before it, Level 7: GenServer, which covers Stateful Processes, Calls and Casts, Designing Reliable Servers.