Designing Elixir Systems with OTP
Write Highly Scalable, Self-Healing Software with Layers
by James Edward Gray, II, Bruce A. Tate
Version: P1.0 (December 2019)
Copyright 2019 The Pragmatic Programmers, LLC. This book is licensed to the individual who purchased it. We don't copy-protect it because that would limit your ability to use it for your own purposes. Please don't break this trustyou can use this across all of your devices but please do not share this copy with other members of your team, with friends, or via file sharing services. Thanks.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and The Pragmatic Programmers, LLC was aware of a trademark claim, the designations have been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking g device are trademarks of The Pragmatic Programmers, LLC.
Every precaution was taken in the preparation of this book. However, the publisher assumes no responsibility for errors or omissions, or for damages that may result from the use of information (including program listings) contained herein.
About the Pragmatic Bookshelf
The Pragmatic Bookshelf is an agile publishing company. Were here because we want to improve the lives of developers. We do this by creating timely, practical titles, written by programmers for programmers.
Our Pragmatic courses, workshops, and other products can help you and your team create better software and have more fun. For more information, as well as the latest Pragmatic titles, please visit us at http://pragprog.com.
Our ebooks do not contain any Digital Restrictions Management, and have always been DRM-free. We pioneered the beta book concept, where you can purchase and read a book while its still being written, and provide feedback to the author to help make a better book for everyone. Free resources for all purchasers include source code downloads (if applicable), errata and discussion forums, all available on the book's home page at pragprog.com. Were here to make your life easier.
New Book Announcements
Want to keep up on our latest titles and announcements, and occasional special offers? Just create an account on pragprog.com (an email address and a password is all it takes) and select the checkbox to receive newsletters. You can also follow us on twitter as @pragprog.
About Ebook Formats
If you buy directly from pragprog.com, you get ebooks in all available formats for one price. You can synch your ebooks amongst all your devices (including iPhone/iPad, Android, laptops, etc.) via Dropbox. You get free updates for the life of the edition. And, of course, you can always come back and re-download your books when needed. Ebooks bought from the Amazon Kindle store are subject to Amazon's polices. Limitations in Amazon's file format may cause ebooks to display differently on different devices. For more information, please see our FAQ at pragprog.com/frequently-asked-questions/ebooks. To learn more about this book and access the free resources, go to https://pragprog.com/book/jgotp, the book's homepage.
Thanks for your continued support,
Andy Hunt
The Pragmatic Programmers
The team that produced this book includes: Andy Hunt (Publisher) Janet Furlow (VP of Operations) Dave Rankin (Executive Editor) Jacquelyn Carter (Development Editor) Jasmine Kwytin (Copy Editor) Potomac Indexing, LLC (Indexing) Gilson Graphics (Layout)
For customer support, please contact .
For international rights, please contact .
Table of Contents
Copyright 2020, The Pragmatic Bookshelf.
Early Praise for Designing Elixir Systems with OTP
This book has a pragmatic approach that (correctly) prioritizes what you need to do over what the frameworks do.
Dave Thomas |
Author of Programming Elixir 1.6 |
James and Bruce have a way of teaching that distills ideas into easily understandable chunks. Designing Elixir Systems with OTP brings their reliable teaching techniques to print. You will walk away with a solid foundation of functional programming design principles and a wheelhouse of simple techniques to help you along your journey.
Amos King |
CEO, Binary Noggin |
This isnt a textbook or a reference. Its a mentorship. It doesnt teach you how to do something. It teaches you how to think about all the things you do in Elixir.
Adrian P. Dunston |
Senior Software Engineer, Papa, Inc. |
This is the book I wish Id had after getting comfortable with Elixir syntax but was struggling to learn crucial core OTP concepts that make it so powerful. The book uses a great coding example to see each of these concepts in use and would have been invaluable to me while fumbling through learning them on my own. 10/10, would recommend.
Jon Carstens |
Embedded Systems Engineer, SmartRent |
A straightforward guide on how to design OTP applications. This book shows some of the best techniques behind popular Elixir projects. A great read for anyone working with Elixir.
Pedro Medeiros |
Senior Software Developer, Shopify |
An invaluable book for Elixir developers wishing to leverage framework/library-agnostic techniques to craft robust, complex, functional systems that are layered and unit testable. Packed with indispensable tips from the trenches, including techniques to integrate with persistence libraries like Ecto, web frameworks like Phoenix, and newer UI frameworks like Scenic.
Eoghan ODonnell |
Experienced Software Engineer |
Acknowledgments
This book was a joint effort. Its written in our shared voice. We will begin our thanks in that same voice, then finish with some personal additions.
You are probably pretty familiar with this drill, but it takes a lot more than authors to make a book. We both need to thank our editor Jackie Carter. She is a champion herder of these two cats. We also need to thank our reviewers: Chris Keathly, Amos King, Bruce Williams, Doyle Turner, Adrian P. Dunston, Pedro Medeiros, Jonathan Carstens, Eoghan ODonnell, Ryan Huber, and Kim Shrier. More so than many other books, we asked them to work through big ideas and no small amount of code while it was still very much under construction. They pushed us back on track whenever we were slipping off.
We want to send special thanks to those pushers of Pimento Cheese, Amos, Anna, and Chris. They were among our first and most ardent supporters, using both the microphone and the electronic pen to advance our book.
Joe Armstrong, a co-creator of the Erlang programming language, died while we were writing this book. Joe had a significant impact on the trajectories of our careers. Joe had a hand in the design of the platform that we now poke around inside of to learn better ways to build software. Were pretty sure Joe would have liked that practice too. We can tell from his conference talks and forum posts that he loved to tinker, explore, and try out new ideas.
Eventually, Jos Valim came along and expanded Joes platform in such way that he convinced these old programmers to give it a chance. Hes cultivating a core team and a language that combine new ideas with Erlangs inner wisdom. Now there are all new ways to play.