Leanpub Header

Skip to main content

The Art of Erlang

Building Concurrent, Fault-Tolerant Systems with the Language of the Telecommunications Era

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

Erlang was created to build systems that never stop. From its origins in telecommunications to modern platforms like WhatsApp and RabbitMQ, its approach to concurrency and fault tolerance has shaped some of the world's most reliable software. This book teaches both the language and the principles behind building resilient, production-ready systems.

Minimum price

$19.00

$29.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
194
Pages
About

About

About the Book

Erlang was born in 1986 inside Ericsson to solve a problem that no other language could handle: building telephone switching systems that must run continuously for years, handle hundreds of thousands of concurrent conversations, and survive hardware failures without dropping a single call. Today, more than forty years later, the principles that made Erlang indispensable for telecommunications are the same principles that power WhatsApp's messaging infrastructure, RabbitMQ's message broker, and countless distributed systems around the world. This book takes you from the very foundations of the language through the full breadth of OTP (the Open Telecom Platform), covering every concept a serious practitioner needs: pattern matching, recursion, lightweight processes, message passing, GenServer and Supervisor behaviours, fault tolerance, distributed programming, ETS and Mnesia data stores, networking, performance optimization, and production deployment. Each chapter builds progressively from beginner to expert level, with extensive code examples, real-world case studies, and deep dives into the internal mechanisms that make Erlang unique. This is not a language reference; it is a practitioner's guide to building systems that run forever.

Author

About the Author

Steve Publications

Steve is a technology professional with more than 20 years of experience in software development, server infrastructure, cybersecurity, vulnerability research and reverse engineering. Throughout his career, he has designed, secured, analyzed and tested complex software and infrastructure, with a particular focus on understanding how systems fail and how they can be made more secure.

Outside of work, Steve enjoys sharing knowledge with the technology community. He collaborates with researchers, industry experts and technology professionals to write practical books covering software development, cybersecurity, cloud computing, networking, DevOps, artificial intelligence and enterprise technologies. His books focus on practical learning through clear explanations, real-world examples and hands-on exercises. With more than two decades of industry experience, his goal is to help IT professionals, students and technology enthusiasts build useful skills and stay current in a rapidly changing industry.

We believe readers deserve to know how our books are created. Most of our authors are not native English speakers, so we use AI to help translate, proofread manuscripts, fix grammar, improve sentence structure and make technical explanations easier to read. AI is used as an editing tool only. It does not replace the research, technical knowledge or hands-on experience behind our books. Some of our authors also prefer to remain anonymous for privacy or professional reasons. In those cases, we publish their work under a different name. The author's name may be different, but the quality of the content and our review process remain the same.

Every book is written, reviewed and maintained by experienced technology professionals, with contributions from our private technical community of more than 400 engineers and researchers from Ukraine, Belarus and Russia. We spend far more time validating technical accuracy and keeping our content up to date than generating text. We are always interested in working with experienced professionals who have deep expertise in a particular technology or domain. If you would like to publish a book with us or help review an existing manuscript, we'd love to hear from you. Send us a message describing your area of expertise. We are especially interested in niche technologies, specialized skills and emerging topics that are underrepresented in existing technical literature.

If you look through the contents of our books, you'll see practical examples, detailed explanations and material that is regularly updated. Our goal is to publish books that professionals can actually rely on, not low-effort AI-generated content. If you ever feel that one of our books does not meet that standard, Leanpub offers a 60-day money-back guarantee. Feel free to request a refund if you are not satisfied with your purchase.

Contents

Table of Contents

Building Concurrent, Fault-Tolerant Systems with the Language of the Telecommunications Era

Introduction

  1. What Makes Erlang Different
  2. Who This Book Is For
  3. How to Read This Book
  4. A Note on Code Examples
  5. The Promise of This Book

Chapter 1: The Origins of Erlang

  1. The Telecom Crisis of the 1980s
  2. Joe Armstrong, Robert Virding, and Mike Williams
  3. From a Research Project to Ericsson’s Secret Weapon
  4. The Design Philosophy: Let It Crash
  5. Open Source and the Birth of the Modern Ecosystem

Chapter 2: Philosophy and Architecture

  1. Immutability and Pure Functions
  2. The Actor Model and Message Passing
  3. The BEAM Virtual Machine
  4. Garbage Collection in a Concurrent World
  5. Comparing Erlang to Other Languages

Chapter 3: Getting Started with Erlang

  1. Installing Erlang/OTP
  2. The Erlang Shell (REPL)
  3. Your First Module
  4. Build Tools: Make, Rebar3, and Mix
  5. Editor Setup and IDEs

Chapter 4: Language Fundamentals – Syntax and Data Types

  1. Variables, Atoms, and the Assignment Model
  2. Numbers: Integers, Floats, and Bignums
  3. Tuples, Lists, and Maps
  4. Binaries and Bit Syntax
  5. Operators and Expressions

Chapter 5: Pattern Matching and Control Flow

  1. The Power of Pattern Matching
  2. Function Clauses and Clause Selection
  3. Case Expressions and Multi-Clause Functions
  4. Guard Expressions
  5. If Expressions and the Receive Construct

Chapter 6: Functions, Modules, and Recursion

  1. Named Functions and Module Organization
  2. Anonymous Functions and Closures
  3. Higher-Order Functions and the Lists Module
  4. Recursion Patterns: Tail Recursion and Accumulators
  5. Recursive Data Processing

Chapter 7: Concurrency – Lightweight Processes and Message Passing

  1. What Is an Erlang Process?
  2. Spawning and Communicating with Processes
  3. The Mailbox and Receive Semantics
  4. Linking and Trapping Exits
  5. Monitoring and the Monitored Process Registry

Chapter 8: The Open Telecom Platform (OTP) – Overview

  1. What Is OTP and Why Does It Exist?
  2. OTP Application Structure
  3. The Behaviour Pattern
  4. OTP Design Principles
  5. Building Your First OTP Application

Chapter 9: GenServer – The Workhorse of OTP

  1. What Is a GenServer?
  2. Implementing a GenServer
  3. Handling Calls, Casts, and Info Messages
  4. State Management and the Code Change Callback
  5. Real-World GenServer Patterns

Chapter 10: Supervisors and Fault Tolerance

  1. The Supervision Tree
  2. Supervisor Strategies
  3. Building Robust Supervision Trees
  4. Dynamic Child Processes
  5. Fault Tolerance in Production

Chapter 11: Applications, Releases, and Deployment

  1. The Application Behaviour
  2. Application Resource Files
  3. Release Management with Rebar3
  4. Deployment Strategies

Chapter 12: Data Storage – ETS, DETS, and Mnesia

  1. ETS – In-Memory Tables
  2. DETS – Disk-Based Storage
  3. Mnesia – Distributed Database
  4. Choosing the Right Storage Mechanism
  5. Performance and Scalability Considerations

Chapter 13: Distributed Programming

  1. Erlang Nodes and the Distributed Runtime
  2. Remote Procedure Calls and Node Communication
  3. Distributed Processes and Global Names
  4. Building Distributed Systems
  5. Network Partitions and Split-Brain

Chapter 14: Networking and Interoperability

  1. TCP and UDP Sockets
  2. Building Network Servers
  3. HTTP and Web Frameworks
  4. NIFs – Native Implemented Functions
  5. Ports and External Program Communication

Chapter 15: Error Handling, Testing, and Debugging

  1. The Error Handling Philosophy
  2. Try-Catch and Exception Types
  3. Testing with Common Test and EUnit
  4. Property-Based Testing with PropEr
  5. Debugging, Tracing, and Profiling

Chapter 16: Performance Optimization and Advanced Patterns

  1. Understanding Erlang Performance Characteristics
  2. Memory Management and Garbage Collection Tuning
  3. Compiler Flags and Code Optimization
  4. Design Patterns in OTP Applications
  5. The Modern Erlang Ecosystem

Chapter 17: Real-World Applications and Case Studies

  1. WhatsApp and the Scale of Erlang
  2. Riak and Distributed Databases
  3. RabbitMQ and Message Brokers
  4. Heroku’s Platform Architecture
  5. Lessons from Production Deployments

Conclusion: The Future of Erlang

  1. Where Erlang Stands Today
  2. Elixir and the BEAM Family
  3. The Continuing Relevance of OTP
  4. Your Path Forward

References

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