Visualisation of Elixir Supervision Tree Strategies

Elixir has built in four strategies for supervision trees to enable fault tolerant systems. The names of strategies are :one_for_one:one_for_all:rest_for_one:simple_one_for_one. Enjoy the visualisations…

Strategy / :one_for_one

:one_for_one / if one of the workers dies, then restart it

Strategy / :one_for_all

:one_for_all / If one dies, supervisor kills the rest and then restart all

Strategy / :rest_for_one

:rest_for_one / If one dies, supervisor kills the rest in start order of these processes and then restart all killed workers

Strategy / :simple_one_for_one

Same as :one_for_one. But it needs to implement Supervision.Spec and you need to specify only one entry in child specification. That means every child spawned from this supervisor is the same kind of a process.


Like what you read? Give Mustafa Turan a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.