My Account Log in

3 options

Mastering Elixir : build and scale concurrent, distributed, and fault-tolerant applications / Andre Albuquerque, Daniel Caixinha.

EBSCOhost Academic eBook Collection (North America) Available online

View online

Ebook Central Academic Complete Available online

View online

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Albuquerque, Andre, author.
Caixinha, Daniel, author.
Language:
English
Subjects (All):
Functional programming languages.
ERLANG (Computer program language).
Physical Description:
1 online resource (574 pages)
Edition:
1st edition
Place of Publication:
Birmingham ; Mumbai : Packt Publishing, 2018.
System Details:
text file
Summary:
Leverage the power of Elixir programming language to solve practical problems associated with scalability, concurrency, fault tolerance, and high availability. Key Features Enhance your Elixir programming skills using its powerful tools and abstractions Discover how to develop a full-fledged file server Understand how to use Phoenix to create a web interface for your application. Book Description Running concurrent, fault-tolerant applications that scale is a very demanding responsibility. After learning the abstractions that Elixir gives us, developers are able to build such applications with inconceivable low effort. There is a big gap between playing around with Elixir and running it in production, serving live requests. This book will help you fll this gap by going into detail on several aspects of how Elixir works and showing concrete examples of how to apply the concepts learned to a fully fledged application. In this book, you will learn how to build a rock-solid application, beginning by using Mix to create a new project. Then you will learn how the use of Erlang's OTP, along with the Elixir abstractions that run on top of it (such as GenServer and GenStage), that allow you to build applications that are easy to parallelize and distribute. You will also master supervisors (and supervision trees), and comprehend how they are the basis for building fault-tolerant applications. Then you will use Phoenix to create a web interface for your application. Upon fnishing implementation, you will learn how to take your application to the cloud, using Kubernetes to automatically deploy, scale, and manage it. Last, but not least, you will keep your peace of mind by learning how to thoroughly test and then monitor your application. What you will learn Use Elixir tools, including IEx and Mix Find out how an Elixir project is structured and how to create umbrella applications Discover the power of supervision trees, the basis for fault-tolerance Create a Domain-Specifc Language (DSL) that abstracts complexity Create a blazing-fast web interface for your application with Phoenix Set up an automatic deployment process for the cloud Monitor your application and be warned if anything unexpected happens Who this book is for Mastering Elixir is for you if you have experience in Elixir programming and want to take it to the next level. This Elixir book shows you how to build, deploy, and maintain robust applications, allowing you to go from tinkering with El...
Contents:
Cover
Title Page
Copyright and Credits
Dedication
Packt Upsell
Contributors
Table of Contents
Preface
Chapter 1: Preparing for the Journey Ahead
Why functional programming?
Elixir and Erlang
Elixir's data types
Integers
Floats
Atoms
Booleans
Tuples
Lists
Maps
Binaries
Strings and charlists
Other types
Keyword lists
Ranges
MapSets
Pattern matching
Pattern matching on tuples
Pattern matching on lists
Pattern matching on maps
Pattern matching on binaries and strings
Functions and Modules
Anonymous functions
Modules and Named Functions
Module attributes, directives, and uses
Working with collections
Looping through recursion
Eager processing with the Enum module
Comprehensions
Lazy processing with the stream module
Control flow
if and unless
cond
case
with
Exceptions
Typespecs and behaviours
Typespecs
Dialyzer
Behaviours
Protocols
Structs
Bringing structs and protocols together
Tooling and ecosystems
IEx
Mix
ExUnit
Erlang interoperability
Summary
Chapter 2: Innards of an Elixir Project
Elixir applications
Elixir project structure
Project dependencies
Umbrella projects
ElixirDrip - our showcase application
Using behaviours
Viewing cross references with xref
Adopting a consistent coding style
Chapter 3: Processes - The Bedrock of Concurrency and Fault Tolerance
Inside the BEAM
Working with processes
Creating processes
Message passing between processes
Building a cache worker
Detecting errors by linking and monitoring processes
Using links
Using monitors
Recovering from errors with supervisors and supervision trees
Defining and starting a supervisor
Streamlined child specs.
Starting children at runtime using dynamic supervisors
Minimizing error effects with supervision trees
Chapter 4: Powered by Erlang/OTP
GenServer
GenServer at your service
Implementing a CacheWorker with GenServer
Agent
Task
Parallel tasks
Using (D)ETS
Disk-based ETS
Registry
Chapter 5: Demand-Driven Processing
GenStage
The upload pipeline
The notifier stage
The RemoteStorage stage
The Encryption stage
The Starter stage
The download pipeline
The Notifier stage
Final remarks
Flow
Sample data
Lazy queries
Disk-usage rank query
Chapter 6: Metaprogramming - Code That Writes Itself
The abstract syntax tree
Tinkering with macros
Hygienic accesses
Famous (un)quotes
Macros - a silver bullet?
Extending modules
Using the use and __using__/1 macros
Creating a domain-specific language
Registering module attributes
Collecting a list of pipeline steps
Generating worker specs and subscription options
Producer stage
ProducerConsumer and Consumer stages
Collecting the pipeline worker specs
Defining the supervisor functions
Streamlining GenStage modules
Simpler pipeline producers
Simpler pipeline (producer) consumers
Macros cheat sheet
Chapter 7: Persisting Data Using Ecto
Connecting to the database
Schemas and migrations
Schemas
Custom field types
Users or media owners?
Schema or not - that is the question
Migrations
Relationships
Changesets
Media
Users
Media ownership
Constraints
Queries
Media folder queries
Loading schemas and their associations
Queries with raw SQL
Finding top users with aggregates
Chapter 8: Phoenix - A Flying Web Framework.
The Plug specification
Creating a module plug
Creating a function plug
Routing requests
Handling requests in a controller
Rendering views
Layouts
Authenticating users
Implementing a JSON API
Authenticating users in the API
Interactive applications using channels
Preparing the server
Joining channels on the client
Exchanging events
Authenticating socket connections
Tracking users statuses using Presence
Chapter 9: Finding Zen through Testing
Unit testing
Testing functions without side-effects
Testing functions with side-effects
Creating mocks with Mox
Testing interactions with the repository separately
Testing the documentation
Integration testing
Testing Phoenix Channels
Testing macros
Property-based testing
Chapter 10: Deploying to the Cloud
Releasing with Distillery
Configuring the release
Interpolating environment variables
Creating the release
Creating a custom release task
Containerizing our application
Creating a development container
Orchestrating more than one container
Composing the deployment containers
Deploying to Kubernetes
Configuring the cloud database
Creating a namespace
Creating secrets
Publishing the production image
Deploying your first pod
Creating a Kubernetes job
Exposing your pods to the world
Continuous deployment with Travis CI
Connecting the deployed Elixir nodes
Testing the connected nodes
Chapter 11: Keeping an Eye on Your Processes
Collecting metrics
Exposing Prometheus metrics
Creating custom Prometheus metrics
Local Prometheus server
Deploying Prometheus in Kubernetes
Calculating percentiles
Setting Grafana variables
A window to your nodes
Connecting to a containerized node.
Connecting to an Erlang node running in Kubernetes
Using a remote shell
Inspecting application behavior
Profiling with the fprof profiler
Tracing with the :dbg module
Other Books You May Enjoy
Index.
Notes:
Includes index.
Description based on print version record.
OCLC:
1050953421

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

Find

Home Release notes

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Find catalog Using Articles+ Using your account