krisleech
Any books or resources to learn Erlang/Elixir OTP patterns?
Hey folks, I’ve been using Elixir for over a couple of years (phx, ecto, broadway, oban).
For this kind of work you do not tend, in my experience, to actually use OTP directly, i.e. write GenServer’s.
The libraries use them and you use the libraries.
You could program web apps in Elixir without needing to really know a great deal about processes/OTP.
Now I want to start learning OTP in depth, I’ve read a few Elixir books (Elixir in Action etc) in the past and just started reading an Erlang book. So I know the basics, what processes are, how to build something like a GenServer by hand, but not how to structure a topology for different use cases,
Are there any books or resources you would recommend which have common erlang/elixir patterns in terms of how to structure processes for different use cases?
It can be Elixir or Erlang, or indeed any BEAM language.
Cheers.
Most Liked
LostKobrakai
I’ve do not really have resources for like blueprints - even though there’s for sure ones like the manager and dynamic workers example of elixir in action.
However I think the usecases define the guarantees you need around isolation and startup/restart/shutdown ordering and usually those translate quite well to supervision trees.
This talk goes especially into the startup side of guarantees (mostly the second half), which often also neatly translate into the shutdown side.
I’d also study the supervision setup of e.g. cowboy(ranch) / bandit(thousand islands) / phoenix channels if you want some real world applications.
manhvu
I came from the Erlang ecosystem, so I haven’t found many good OTP resources for Elixir (or maybe I just missed them). Most of the OTP documentation and books I recommend are written for Erlang, and they’re still highly relevant because Elixir runs on the BEAM and uses the same OTP principles.
My recommended resources for advanced OTP programming:
-
The best OTP documentation is the official Erlang Design Principles guide (free):
Overview — Erlang System Documentation v29.0.3 -
The easiest way to understand how Processes and GenServers work is Programming Erlang (2nd Edition) by Joe Armstrong, the creator of Erlang:
Programming Erlang (2nd edition) by Joe Armstrong -
For a deep dive into the BEAM and how the system works, read The BEAM Book (open source):
GitHub - happi/theBeamBook: A description of the Erlang Runtime System ERTS and the virtual Machine BEAM. · GitHub
manhvu
I really enjoyed Learn You Some Erlang for Great Good!. It explains concepts in a fun and easy-to-understand way.
Last Post!
Hermanverschooten
I liked this one very much, Designing Elixir Systems with OTP, by Bruce (from @GroxioLearning) and James @JEG2
Popular in Chat/Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









