4 ms·
I hear a lot of hype about supervisor trees from Erlang folks, but very little description about what they do or why they’re useful. Are they applicable to othe
by weberc2 8y ago
I hear a lot of hype about supervisor trees from Erlang folks, but very little description about what they do or why they’re useful. Are they applicable to other languages? Could someone point me to a good resource for someone who doesn’t know Erlang or Elixir?
- Zalastax 8y agoThey are very useful if you follow the philosophy of Erlang: let it crash. It's really important to get easy to understand distributed systems. A good introduction: https://learnyousomeerlang.com/supervisors https://learnyousomeerlang.com/supervisors
- vberg 8y agohttps://learnyousomeerlang.com https://learnyousomeerlang.com https://learnyousomeerlang.com/supervisors https://learnyousomeerlang.com/supervisors This book is imho a fantastic read that helped me understand Erlang a lot.
- pdimitar 8y agoIt is basically "whatever thing in your system has an external dependency that's not 100% reliable, isolate it in an actor/process that can crash and be safely restarted". Expand the concept to trees of dependencies and several possible after-crash strategies and you get very resillient apps. But to fully appreciate it, you have to try it. It sounds pretty generic when advocated for but when you code a bit around that, it gets pretty amazing.
- mirceal 8y agoYes. The concepts are applicable basically everywhere. For example: do you know how systemd restarts your service if it crashes? How about how k8s behaves when your health probes fail? It’s everywhere. Build it to crash fast if it has a problem. Have a higher level entity that monitors it and automatically restarts it/does something when it does crash. Now go meta and have supervisors watching supervisors and controllably crash or restart bigger parts of your system. (This is based on the “crash early”, “keep state consistent”, “have you tried turning it off and on” principles. It’s not new and you’re probably already doing it tona certain degree)
- losvedir 8y agoI really like this description[0]. It's broadly about designing programs, and handling robustness and state, so I imagine it would apply to other languages, although it does mention some erlang specific things. [0] http://jlouisramblings.blogspot.com/2010/11/on-erlang-state-and-crashes.html http://jlouisramblings.blogspot.com/2010/11/on-erlang-state-...