A restart strategy tells a supervisor how to respond when a supervised child terminates. The default example, :one_for_one, starts a replacement while leaving sibling processes alone. section 8.3.2
A process is not literally restarted: the supervisor terminates the failed process and starts another process from the same module. The replacement receives a new PID and does not share the old process state. section 8.3.2
Choose the strategy according to how children depend on one another:
- :one_for_one replaces only the terminated child. section 9.1.6
- :one_for_all terminates the other children, then starts all children again when one child crashes. section 9.1.6
- :rest_for_one terminates younger siblings of the failed child, then replaces the terminated children. section 9.1.6
Use :one_for_all when siblings depend on one another in every direction. Use :rest_for_one when younger children depend on older ones, such as database workers depending on a registry. section 9.1.6
Configuring a supervisor
Supervisor.start_link([Todo.Cache], strategy: :one_for_one) starts the cache under supervision. Killing the cache causes the supervisor to start a replacement, allowing the system to continue serving requests. section 8.3.2

