
RELIABLE WEB APPS WITH ELIXIR
AND


Ales Tsvil
Intro
Elixir
Phoenix
INTRODUCTION

Elixir


What is Elixir?




Features
- Pattern Matching
- Data Immutability
- Simple Multithreading
- Metaprogramming
- Data Structures
- Full Functional
- Modular Structure
- Erlang VM
Most operators are functions
Pipe Operator |>
Built-in Libraries for almost everything!
Infrastructure for almost whole server-side needs
REPL
Existing Toolchain

What is Erlang?
-
Created in 1986
- Windows in 1985
- Linux in 1991
- Handles 50% of the world telecom traffic
- Reported 99.999999% of availability
DISTRIBUTED SYSTEMS
TREE OF SUPERVISORS
POSSIBLE ETERNAL
LIFETIME

GAPS?

PRODUCTIVE.
RELIABLE.
FAST.

Let it Crash?
List of things
- The Endpoint
- The Router
- Controllers
- Views
- Templates
- Channels
- PubSub
- handles all aspects of requests up until the point where the router takes over
- provides a core set of plugs to apply to all requests
- dispatches requests into a designated router
ENDPOINT
- parses incoming requests and dispatches them to the correct controller/action, passing parameters as needed
- provides helpers to generate route paths or urls to resources
- defines named pipelines through which we may pass our requests
- Pipelines
- allow easy application of groups of plugs to a set of routes
ROUTER
- provide functions, called actions, to handle requests
- Actions
- prepare data and pass it into views
- invoke rendering via views
- perform redirects
CONTROLLER
- render templates
- act as a presentation layer
- define helper functions, available in templates, to decorate data for presentation
- are what they sound like :)
- are precompiled and fast
VIEWS
TEMPLATES
- manage sockets for easy realtime communication
- are analogous to controllers except that they allow bi-directional communication with persistent connections
CHANNELS
- underlies the channel layer and allows clients to subscribe to topics
- abstracts the underlying pubsub adapter for third-party pubsub integration
PUBSUB
PLUG AND ECTO

MICROSERVICES
FRONT-END



Any Questions?
tsvil_@tut.by
diodread
Thank You!

Elixir
By diodredd
Elixir
- 459