PragmaticBookshelf

PragmaticBookshelf

Forum Sponsor

Elixir Patterns (PragProg)

Alexander Koutmos @akoutmos

Elixir Patterns aims to surface the powerful and unique characteristics of the Erlang virtual machine and show you how to solve everyday problems in a simple yet scalable way. Not only will you master the tools at your disposal courtesy of Erlang and the BEAM, you will also learn how to better utilize functional programming in order to achieve your goals in a clear and concise way. The idea of having a “go-to” toolbox of patterns you can leverage is an enticing one - that is what design patterns are all about! This book forgoes the abstract and instead provides concrete examples to help you better leverage the unique properties of Elixir, Erlang, and BEAM.

The Erlang programming language was first released in 1986 and to this day continues to have a tremendous impact on the field of computer programming. This impact is apparent when you look at how many other programming languages have actor model frameworks that mirror the semantics of Erlang and how many recent programming languages have emerged that make use of functional programming concepts. In addition, while many other programming languages and their runtimes require external tools in order to deal with application crashes, users of the Erlang virtual machine (or BEAM as it is colloquially called) enjoy fault-tolerant constructs that are built right into the runtime.

While the Erlang syntax may not be for everyone, we can still leverage the benefits of Erlang and the BEAM through the Elixir programming language. Elixir provides us an alternative programming language that can target the same runtime as Erlang while also leaning on the Erlang standard library. You essentially get all of the benefits of Erlang and the BEAM along with all of the tools available to you through the Elixir standard library.

This book guides you through the Erlang standard library and how you can leverage it from Elixir as well as how you can structure applications in order to make the most out of the unique runtime that is the BEAM. By the end of this book you will be comfortable constructing your own supervision trees, using processes, leaning on ETS and persistent term for when performance is a primary concern, and how you can use both the mutable and immutable data structures that are available in the Erlang standard library. In addition, you’ll learn how you can package these language and runtime primitives into reusable patterns in order to solve common problems that you may encounter in your day to day applications.

This work was written and produced entirely by the author. We are proud to be distributing it.


Alexander Koutmos has been professionally writing software for over a decade and has been primarily working with Elixir since 2015. He currently maintains a number of Elixir libraries on Hex, is a host on the BEAM Radio podcast, and wrote a book about Building a Weather Station with Nerves and Elixir.


Full details: Elixir Patterns: The essential BEAM handbook for the busy developer by Alexander Koutmos


Don’t forget you can get 35% off with your Devtalk discount! Just use the coupon code “devtalk.com" at checkout :+1:

Most Liked

AstonJ

AstonJ

Edit: Please note this book is now distributed by PragProg so the original thread (this post, all the way down to this post) has been merged into this thread.



By @akoutmos and @hugobarauna

You already know the basics of Elixir. Maybe you have even shipped something to production. That’s awesome! But how can you go one step further in your Elixir developer journey?

This book will help you to become a better Elixir developer by teaching you how to leverage the power of the BEAM runtime with recipes and patterns specific to Elixir/OTP.

About the book

The idea of having a “go-to” toolbox of patterns that you can leverage is an enticing one. That’s what design patterns are about. But, design patterns are usually abstract and do not leverage unique properties of your specific run-time or language. That’s how this book is different.

This book aims to surface the powerful and unique characteristics of the Erlang virtual machine (or BEAM for short) and show you how you can go about solving everyday problems in a simple yet scalable way.

Not only will you learn how to better leverage the tools that are at your disposal courtesy of Erlang and the BEAM, but you will also learn how to better utilize Functional Programming in order to achieve your goals in a clear and concise way. You’ll start off by learning about some of the Erlang standard library utilities that are available to you right out of the box, and then you’ll learn how to put those to use in your stateful GenServer powered applications.

What you’ll learn in this book:

  1. The Erlang Standard Library Part 1
  2. What are Data Structures
  3. Using Queues in Erlang
  4. The Many Set Implementations in Erlang
  5. Arrays…in Erlang?
  6. Using the Erlang Module for Everyday Tasks
  7. The Erlang Standard Library Part 2
  8. Directed Graphs with the Digraph Module
  9. Fast Incrementers with Atomics and Counters
  10. Blazing Fast Data Reads with Persistent Term
  11. Using ETS and DETS for General Purpose Data Storage
  12. Keeping Things Secret with the Crypto Module
  13. The Elixir Standard Library
  14. Useful Enum Module Patterns
  15. Being Lazy with the Stream Module
  16. Massive Concurrency with the Task Module
  17. The Process Module
  18. GenServers and Supervisors
  19. Erlang Application Philosophy
  20. What is a GenServer?
  21. Understanding the Callbacks
  22. The Lifecycle of a GenServer
  23. What is a Supervisor
  24. Combining Supervisors and GenServers
  25. Basic GenServer Recipes
  26. Initializing an Application
  27. Message and Data Batching
  28. Running Cron Jobs
  29. Process Introspection with the Sys Module
  30. Advanced GenServer Recipes
  31. Rate Limiting
  32. Work Delegator
  33. Actor Model Design
  34. Testing Stateful Applications
  35. Application Release Packaging
  36. What is an Erlang Release
  37. Why Should you use Erlang Releases?
  38. Handling Application Configuration
  39. Behaviours and Protocols for Environment Specific Adapters
37
Post #2
akoutmos

akoutmos

Author of Build a Weather Station with Elixir and Nerves

Apologies for the delay with the Elixir Patterns book. My wife and our newborn both fell very ill back in February and I had to put a pause on pretty much everything from the book, open source, blogging, podcasting and everything inbetween in order to take care of the family. My wife was fairly close to death’s door, but thank God she has recovered and is improving day by day. Still a long way to go but we’re getting there.

I am hoping that I will be back to writing the book in a few weeks. And after that hopefully back to doing some open source work. It’s been a long road for the family and I appreciate all the support from the Elixir community :heart:.

akoutmos

akoutmos

Author of Build a Weather Station with Elixir and Nerves

@hugobarauna and I have some fantastic news…the Elixir Patterns books is complete and in release candidate!!

The eighth and final chapter dives into:

  • Building a Scalable Actor Model with Caching Support: Learn how to architect a high-performance, fault-tolerant system using GenServers, ETS, and DynamicSupervisor.
  • Implementing a Fault-Tolerant ETS Cache: Discover techniques to make your ETS caches resilient to failures, ensuring that your system can recover and maintain state even after unexpected process crashes.
  • Adapter Pattern in Elixir: Understand how to use Elixir’s behaviours to implement the adapter pattern, allowing you to easily swap out dependencies at run-time or compile-time.

Here is a sneak peak at the final boss supervision tree :smiley:

This is the first release candidate of Elixir Patterns which means that the book’s content is complete, but we expect minor adjustments and potential errata. If you haven’t so already, be sure to pick up your copy at: https://elixirpatterns.dev/

Where Next?

Popular in Books Top

PragmaticBookshelf
Frank Hunleth @fhunleth Bruce A. Tate @redrapids edited by Jacquelyn Carter @jkcarter Want to get better at coding Elixir? Write a har...
New
PragmaticBookshelf
Sean Moriarity @seanmor5 edited by Tammy Coron @Paradox927 From finance to artificial intelligence, genetic algorithms are a powerful to...
New
germsvel
:waving_hand: Hi there, I’ve been working on a Test-Driven Development with Phoenix book. It teaches TDD and BDD by building a chat app ...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
AstonJ
Don’t forget you can get 35% off the ebook using the code ‘devtalk.com’ :023: Current: Search Original: Search For those looking for ...
New
New
PragmaticBookshelf
Peter Ullrich (@PJUllrich) edited by Michael Swaine @michaelswaine Data is at the core of every business, but it is useless if nobody ca...
New
PragmaticBookshelf
Tony Hammond Series editor: Bruce A. Tate @redrapids Developmental editor Jacquelyn Carter @jkcarter Data is everywhere—it’s just not ...
New
AstonJ
by Joe Armstrong A multi-user game, web site, cloud application, or networked database can have thousands of users all interacting at th...
New
codestirring
Hey Elixir Forum, I’ve written a ebook called the Phoenix LiveView Cookbook which I’ve written in the hopes of distilling the knowledge ...
New

Other popular topics Top

WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31194 112
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement