Designing Elixir Systems with OTP
Write Highly Scalable, Self-Healing Software with Layers
by: James Edward Gray, II and Bruce A. Tate
Published | 2019-12-10 |
---|---|
Internal code | jgotp |
Print status | In Print |
Pages | 246 |
User level | Intermediate |
Keywords | Elixir, OTP, libraries, layers, API, concurrency, designing, programming, data structures, functional programming, testing, web application development |
Related titles |
|
ISBN | 9781680506617 |
Other ISBN |
Channel epub: 9781680507379 Channel PDF: 9781680507386 Kindle: 9781680507355 Safari: 9781680507362 Kindle: 9781680507355 |
BISACs | COM051010 COMPUTERS / Programming Languages / GeneralCOM051240 COMPUTERS / Software Development & Engineering / Systems Analysis & DesignCOM051240 COMPUTERS / Software Development & Engineering / Systems Analysis & Design |
Highlight
You know how to code in Elixir; now learn to think in it. Learn to design libraries with intelligent layers that shape the right data structures, flow from one function into the next, and present the right APIs. Embrace the same OTP that’s kept our telephone systems reliable and fast for over 30 years. Move beyond understanding the OTP functions to knowing what’s happening under the hood, and why that matters. Using that knowledge, instinctively know how to design systems that deliver fast and resilient services to your users, all with an Elixir focus.
Description
Elixir is gaining mindshare as the programming language you can use to keep your software running forever, even in the face of unexpected errors and an ever growing need to use more processors. This power comes from an effective programming language, an excellent foundation for concurrency and its inheritance of a battle-tested framework called the OTP.
If you’re using frameworks like Phoenix or Nerves, you’re already experiencing the features that make Elixir an excellent language for today’s demands. This book shows you how to go beyond simple programming to designing, and that means building the right layers. Embrace those data structures that work best in functional programs and use them to build functions that perform and compose well, layer by layer, across processes. Test your code at the right place using the right techniques. Layer your code into pieces that are easy to understand and heal themselves when errors strike.
Of all Elixir’s boons, the most important one is that it guides us to design our programs in a way to most benefit from the architecture that they run on. The experts do it and now you can learn to design programs that do the same.
Contents and Extracts
- <b>Introduction</b>
- Build Your Project in Layers <b>excerpt</b>
- We Must Reimagine Design Choices
- Choose Your Layers
- Begin with the Right Data Types
- Build Your Functional Core
- Establish Your Boundaries
- Test Your Code
- Plan Your Lifecycle
- Invoke your Workers
- Build Your Project in Layers <b>excerpt</b>
- Do Fun Things…
- Know Your Elixir Datatypes
- Primitive Types
- Lists
- Maps and Structs
- Strings
- Tuples
- Functions as Data
- When to Leave Elixir
- Know Your Elixir Datatypes
- Start with the Right Data Layer
- Access Patterns Shape Data Structures
- Immutability Drives Everything
- Try It Out
- Start with the Right Data
- Build a Functional Core
- Organize Core Functions by Purpose
- Compose a Quiz from Functions
- Build at a Single Level of Abstraction
- Keep the Left Margin Skinny
- Try Out the Core
- Build Your Functional Core
- Test Your Core
- Simplify Tests with Common Setup Functions
- Improve the ExUnit Infrastructure
- Provide Test Data with Fixtures
- Prime Tests with Named Setups
- Make Tests Repeatable
- Compose Within Tests
- Take Tests Beyond the Elixir Base
- Test Your Functional Core
- Know Your Elixir Datatypes
- …with Big, Loud Worker-Bees
- Isolate Process Machinery in a Boundary
- Maintain Composition Through Uncertainty
- Build Your Optional Server
- Wrap the Server in an API
- Prefer Call Over Cast to Provide Back Pressure <b>excerpt</b>
- Extend Your APIs Safely
- Wrap Your Core in a Boundary API
- Customize Your Lifecycle
- Understand the Lifecycle Building Blocks
- Configure Applications to Start Supervisors
- Start Per-User Processes with a Dynamic Supervisor
- Touch Up the API Layer
- Manage Your Lifecycles with Supervisors
- Summon Your Workers
- Know Your Motivations
- Know Your Tools
- Add a Proctor to Run Timed Quizzes
- Summon Your Workers
- Assemble Your Components
- Add Persistence as a Boundary Service
- Integrate MasteryPersistence into Mastery
- Integrate Your OTP Dependencies into Phoenix
- Organize Code for OTP Abstractions
- Build Scenic Projects with Layers
- Assemble Your Components
- Test the Boundary
- Tests Call the API as a User Would
- Isolate the Proctor’s Boundary Concerns
- Test Your Boundary
- Isolate Process Machinery in a Boundary