Anyone have any recommendations for books that focus on the distributed side of Elixir?

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.

1 Like

Elixir in Action has a chapter on distribution, and Engineering Elixir Applications has a chapter on deploying distributed applications. The Little Elixir and OTP Guidebook also has a couple chapters on the subject.

5 Likes

Concurrent Data Processing in Elixir deals with distributed consumer-producer systems using e.g. Broadway, and explaining supervisor details.

1 Like

:point_up: This book does not mention distributed systems at all.

1 Like

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.

4 Likes

We ran a bookclub on EIA last year so it’s only fair we run one on PE this year :smiley: Fancy by the leader for it? :blush:

1 Like

Thanks @slouchpie BUT it sounds more Erlang focused than Elixir focused, is my assumption right?

1 Like

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.

5 Likes

+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 :slight_smile: .

7 Likes

I would also agree with reading erlang material since there is already content for it.

Learn you some erlang has also some good chapters about the distributed part of the OTP (the last chapters)

1 Like

I do not feel qualified to lead this. I understood less than 50% of the book when I read it.

1 Like

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:

{:ok, :erpc.call(node, mod, func, args, timeout)}

That is from this Elixir library: fly_rpc_elixir/lib/fly_rpc.ex at main · superfly/fly_rpc_elixir · GitHub

It is calling a function from the Erlang erpc module (erpc — kernel v10.2.2).

“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).

1 Like

Sorry I thought you said Programming Elixir (I was just off to bed when I posted) :icon_redface: 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 :smiley:

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.

1 Like

If I recall correctly, we ran on PE too, I remember being part of it and talking to you a about it. Unless I am confusing it with some other books :man_shrugging:

2 Likes

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 :blush:

Thank you all for the suggestions! I think it’s time to read some Erlang books :slight_smile:

1 Like