Does anyone have any recommendations for books that focus on the distributed side of elixir?
I am fairly comfortable with the language along with most of the standard library as well as OTP primitives, etc, but I’m looking to get more familiar with designing distributed applications.
Ideally I would prefer books that are not written in/for erlang but I understand there will probably be good references that are in that category as well.
I would recommend “Programming Erlang” by Joe Armstrong. It has a lot of good info and it can all be used in Elixir. When I read it, I did not understand a lot of it. I intend to re-read it this year.
I remember a chapter about libs like :rpc and :global and I also remember the clear info about how distributed Erlang was designed to be run on a LAN (as opposed to on the general internet). There was stuff about cookie sessions and encryption that I can not remember any more.
I recommend this book because it contained more knowledge than I could absorb about distributed Erlang.
Distribution is a VM feature first and foremost. You‘ll be using the exact same primitives across the whole ecosystem no matter the language used. Only higher level libraries will then start to make a difference.
+1 for “Programming Erlang” and “Designing for scalability with Erlang/OTP”.
Those two books opened my mind to a lot of ideas and were very influential for me recently.
Don’t fear the Erlang side, the concepts (of course) map very well to Elixir and you’ll get a very solid (or a better) understanding of OTP behaviours.
For the distributed side and scalability, I guess the main takeaway is “it depends”. On your scale, requirements, tradeoffs, team… The book is very nuanced.
A little personal example : after reading “Designing for scalability with Erlang/OTP” I changed my SLA to 99.5% for my SAAS and added two “maintenance windows” in my contracts that allow me to perform planned downtime. That looks like an outdated practice and very low availability today.
In practice systems stroll around 5 nines and I don’t use those windows. It’s easy at my scale. But availability has first to do with human expectations and human availability. If there’s a global DNS or worse outage while I’m driving someone to the hospital, there’ll be downtime. Without people on call or 24/7 shifts I can’t promise more, whatever tech and distribution strategies I’d be using.
That’s the kind of very immediate practical takeaway I got from those books .
Yes, it is completely right. However, I would suggest reading it all the same. If you start using Elixir libraries that deal with distributed systems, you will see code like this:
“Programming Erlang” clearly describes how these RPC calls work, in human language. It even talks about “Client and Server on Different Hosts in the Internet” in the context of doing RPC calls.
It is common to call Erlang functions from Elixir code in this way. They always look like
:some_erlang_module.do_something(args)
You have probably seen :rand.uniform() to generate a random float between 0 and 1? This is a simple understandable example of using the Erlang rand module (rand — stdlib v6.2).
So I would say that you don’t need to be able to read or write Erlang code to understand a lot of the book. You can use the relevant functions like they are Elixir functions. They will just :look.like_this() instead of Looking.like_this().
Finally, there are a lot of books I have not read. This is just the best one I have read for understanding distributed Erlang/Elixir. I am not an expert (yet).
Sorry I thought you said Programming Elixir (I was just off to bed when I posted) though I think it could be worth doing a book club on both those books at some point, perhaps ask one of the Erlang Core Team if they could lead the Programming Erlang bookclub
I found Erlang books covering distributed programming better, with more chapters dedicated to it. Elixir books have good focus on concurrency but often only 1 chapter for distributed systems.
“Learn You Some Erlang for Great Good” is free and going can skim through some of the chapters and see if that’s what you want.
“Programming Erlang” has nice coverage and I recently finished that book, while some of the contents may feel outdated but I think the “Distributed Section” still has good material still relevant.
I have not yet read it but I heard great stuff about Designing for Scalability with Erlang/OTP. I wish someone wrote an idiomatic Elixir version of that book.
Yeah it was on devtalk: Programming Erlang Book Club - Journals & Book Clubs - Devtalk - I actually really enjoyed that bookclub, shame I didn’t get around to finishing the book tho. You should post your thoughts if you did manage to finish it, bring the club to a nice close