Leanpub Header

Skip to main content

The Professional’s Guide to Elixir

A Comprehensive Guide to Functional Programming, Concurrency, and Fault-Tolerant Systems

This book is 100% completeLast updated on 2026-07-07

Build reliable, scalable software with The Professional’s Guide to Elixir. Learn functional programming, BEAM concurrency, OTP fault tolerance, metaprogramming, and modern web development with Phoenix and LiveView. This book gives you the practical knowledge to create systems that scale and stay resilient.

Minimum price

$19.00

$29.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
WEB
APP
About

About

About the Book

Elixir is a dynamic, functional programming language that runs on the Erlang virtual machine (BEAM), the same battle-tested runtime that powers WhatsApp's billion-user messaging infrastructure and Discord's real-time voice platform. This book takes you from your first Elixir program to building production-grade distributed systems. You will learn the language's core syntax and data types, master functional programming patterns, understand the BEAM virtual machine's legendary concurrency model, build fault-tolerant applications with OTP supervision trees, wield powerful metaprogramming macros, deploy scalable web applications with Phoenix and LiveView, and navigate the complete Elixir toolchain from Mix to Hex to Dialyzer. Whether you are a beginner discovering functional programming for the first time or an experienced developer seeking deep expertise in concurrent software architecture, this book provides the knowledge, practical examples, and real-world insights you need to write software that scales gracefully and survives failure.

Share this book

Bundle

Bundles that include this book

Author

About the Author

Steve T. Publications

Steve T. is a cybersecurity leader, researcher, and engineer with more than 20 years of experience across application security, infrastructure security, vulnerability management, software development, and secure engineering practices. Having built his career alongside the growth of the modern internet, he has worked through multiple generations of technology, evolving security threats, and changing development methodologies.

He is currently part of the advanced research organization at a leading cybersecurity company, where he focuses on emerging threats, security innovation, and the practical application of research. His work involves investigating new attack techniques, evaluating emerging technologies, conducting deep technical analysis, and helping organizations better understand and manage complex security risks.

In addition to his research responsibilities, Steve leads a team of senior engineers and subject matter experts who create technical books, training programs, and educational resources for security professionals. Through this work, he helps engineers, developers, architects, and security practitioners strengthen their skills and build more secure systems.

Steve's technical expertise spans software development, reverse engineering, web application security, penetration testing, security architecture, incident response, vulnerability research, operating system internals, and secure software development. His ability to analyze systems at both the source code and binary levels enables him to bridge the worlds of software engineering, security research, and practical defense.

Over the course of his career, Steve has worked with organizations across a wide range of industries, helping them identify, assess, and remediate security weaknesses in critical applications and infrastructure. He is recognized for combining deep technical expertise with a pragmatic approach to security, focusing on solutions that are effective, sustainable, and aligned with business goals.

Through his work in research, engineering, leadership, and education, Steve continues to contribute to the advancement of cybersecurity and the development of secure, resilient technology systems.

Contents

Table of Contents

A Comprehensive Guide to Functional Programming, Concurrency, and Fault-Tolerant Systems

Introduction

  1. The Problem Modern Software Faces
  2. Why Elixir Deserves Your Attention
  3. What This Book Will Teach You
  4. How to Read This Book

Chapter 1: History and Philosophy

  1. The Erlang Legacy: From Ericsson to the Internet Age
  2. José Valim and the Birth of Elixir
  3. Ruby-Inspired Syntax, Functional Soul
  4. Core Design Principles: Immutability, Pattern Matching, Composability
  5. The Elixir Manifesto and Community Values

Chapter 2: Getting Started and Core Language Fundamentals

  1. Installing Elixir and Your First Program
  2. IEx: The Interactive Shell as Development Companion
  3. Data Types: Atoms, Tuples, Lists, Maps, Keywords, Strings, Binaries
  4. Variables and Immutability
  5. Basic Operators and Expressions
  6. Naming Conventions and Style Guide

Chapter 3: Functions, Pattern Matching, and Control Flow

  1. Defining Functions and Modules
  2. Function Clauses and Multiple Heads
  3. Pattern Matching in Depth
  4. Guards and Guard Expressions
  5. Case, Cond, With, If/Unless
  6. Anonymous Functions and Closures

Chapter 4: Functional Programming Patterns

  1. Higher-Order Functions and the Enum Module
  2. The Pipeline Operator (|>) and Readability
  3. Recursion vs. Iteration
  4. Function Composition and Partial Application
  5. Immutability and Structural Sharing
  6. Error Handling with :ok/:error Tuples and the With Special Form

Chapter 5: The BEAM Virtual Machine

  1. BEAM Architecture: Process Table, Code Server, Garbage Collector
  2. Schedulers and CPU Utilization
  3. Memory Management and Per-Process Garbage Collection
  4. The Scheduler Algorithm and Work Distribution
  5. BEAM Limits and Scaling Characteristics
  6. Comparing BEAM to Other Runtimes

Chapter 6: Processes and Concurrency

  1. What Are Lightweight Processes?
  2. Spawning and Linking Processes
  3. Message Passing with receive/send
  4. Monitors and Asynchronous Observation
  5. Process Registry and Named Processes
  6. Concurrency Patterns: Worker Pools, Pipelines, Scatter-Gather

Chapter 7: OTP Framework and Supervision Trees

  1. What Is OTP? History and Design Philosophy
  2. GenServer: The Workhorse Behavior
  3. Agent and Task Behaviors
  4. Supervisor Strategies: One-for-One, One-for-All, Rest-for-One, SimpleOneForOne
  5. Application Behavior and Lifecycle Management
  6. Building Supervision Trees: Topologies and Best Practices

Chapter 8: Fault-Tolerant Design Patterns

  1. The Let-It-Crash Philosophy
  2. Circuit Breakers and Rate Limiters
  3. Distributed State and Consensus Patterns
  4. Graceful Degradation and Fallback Strategies
  5. Heartbeats, Health Checks, and Self-Healing Systems
  6. Real-World Fault Tolerance: WhatsApp, Discord, Pinterest Case Studies

Chapter 9: Metaprogramming with Macros

  1. The Elixir AST and Code as Data
  2. Quote and Unquote
  3. Writing Macros with defmacro
  4. Macro Hygiene and Variable Capture
  5. Building Domain-Specific Languages (DSLs)
  6. When to Use Macros (and When Not To)

Chapter 10: Distributed Systems

  1. Erlang Distribution Protocol
  2. Connecting Nodes and Clustering Strategies
  3. RPC and Remote Process Calls
  4. Global Registry and Distributed State Management
  5. Building Distributed Applications: Patterns and Pitfalls

Chapter 11: The Complete Elixir Toolchain

  1. Mix: Build Tool, Task Runner, and Project Manager
  2. Hex: Package Management and Publishing
  3. IEx Advanced Features: Debugging, Profiling, Remote Shells
  4. ExUnit: Testing Framework and Assertions
  5. Dialyzer: Static Analysis and Type Specifications
  6. Documentation Tools: ExDoc and Livebook
  7. CI/CD Integration: GitHub Actions, Jenkins, Docker

Chapter 12: Testing, Debugging, and Code Quality

  1. Unit Testing with ExUnit: Setup, Context, Async Tests
  2. Integration Testing Strategies
  3. Property-Based Testing with StreamData
  4. Mocking and Stubbing: Bypass, Mox, FakeServer
  5. Debugging Tools: IEx.pry, Logger, Remote Shells
  6. Code Quality: Dialyzer, Credo, Formatter, Sobelow

Chapter 13: Web Development with Phoenix and LiveView

  1. Phoenix Architecture: Controllers, Views, Plugs, Channels
  2. Phoenix LiveView: Real-Time Interactivity Without JavaScript Frameworks
  3. Authentication and Authorization Patterns
  4. API Development with JSON APIs
  5. Deploying Phoenix Applications

Chapter 14: Database Layer with Ecto

  1. Ecto Architecture: Schemas, Repositories, Queries, Changesets
  2. Database Migrations and Schema Evolution
  3. Writing Queries with Ecto.Query and Dynamic Expressions
  4. Associations and Joins
  5. Changesets for Data Validation and Sanitization
  6. Performance: N+1 Queries, Preloading, Indexing

Chapter 15: Performance, Deployment, and Production Operations

  1. Benchmarking with Benchee and Profiling with :profiler/FProf
  2. Performance Optimization Techniques
  3. Building Releases with Mix Release
  4. Docker and Containerization Strategies
  5. Monitoring: Telemetry, Prometheus, Grafana, Oban for Background Jobs
  6. Production Best Practices: Logging, Configuration, Secrets Management

Chapter 16: Real-World Projects and Case Studies

  1. Project 1: Building a Real-Time Chat Application
  2. Project 2: A Distributed Task Queue System
  3. Project 3: High-Throughput Data Processing Pipeline
  4. Architecture Decisions and Trade-offs

Chapter 17: The Ecosystem, Comparisons, and When to Choose Elixir

  1. Popular Libraries and Frameworks Beyond Phoenix
  2. The Elixir Community and Learning Resources
  3. Elixir vs. Erlang: When to Use Which
  4. Elixir vs. Other Languages (Go, Rust, Java, Python, Node.js)
  5. Decision Framework: When to Choose Elixir
  6. Common Pitfalls and Anti-Patterns
  7. The Future of Elixir

Conclusion

  1. What We Have Learned
  2. The Elixir Advantage in Modern Software Engineering
  3. Where to Go From Here

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub