2. Erlang
• Erlang is a dynamically-typed, garbage-collected,
concurrent, functional programming language that
compiles to byte code and runs on a virtual machine
• Created at Ericsson in 1986 and is completely open
sourced (Apache v2)
• Syntax is loosely based on Prolog
3. Erlang (cont.)
• Share-nothing message passing (a.k.a Actor Model)
• Light weight processes (a.k.a Green Threads)
• Immutable Data Structures
• Type annotations
• Per Process Garbage Collector (soft real-time)
• Hot code loading
• Location transparency
• Runtime system monitoring and observation
• Built-in NoSQL database with ACID transactions
4. Open Telecom Platform
• A set of design guidelines and libs for developing
fault-tolerant, soft real-time, distributed systems
• Battle tested for over 30 years in the Telecom
industry and more recently at most of the leading
Internet companies
• Promotes a “let-it-crash” + “software watchdogs”
approach for fault-tolerance, normalizes some
aspects of Erlang
5. Why Elixir?
• Modern Syntax
• Unicode Strings
• Fix Accidental Complexity (dict/orddict/gb_tree)
• Meta-Programming, Protocols, Pipeline Operator, ..
• Advanced tooling and interactive development
• Superb web framework (Phoenix)
9. OTP Concepts
• Messages handled in order they are received to
avoid message leak
• Supervisor Trees – watchdogs for processes with
multiple monitor and restart strategies
• Well-defined sets of callbacks for processes that
follow the same pattern (e.g GenServer implements
start, init, handle_call, handle_cast, handle_info,
code_change, …)
• Applications – bundle modules, servers, supervisors
and configs as a single logical unit (e.g. Logger, Db)
• Release – A complete system of multiple applications
bundled together under a version number with
support for differential upgrades
10. Runtime Observer
• Connect to remote system
• View running processes
• View process mailboxes
• Trace messages
• View Applications
• View Supervision Trees
• View Performance Metrics
• View Logs
• Restart Processes
• View System Information
11. Phoenix Performance
Language Framework Throughput (req/s)
Go Gin 51,483
Elixir Phoenix 43,063
JavaScript (NodeJS) Express 9,966
Ruby Rails 3,275
• Benchmarks should never be taken too literally
• Express Cluster and Rails5 make better use of multi-core CPUs and exhibit better throughput
• YMMV
12. Elixir @ Spectory
Websites and Webapps
Mobile Backends
IoT Backends
Scripts
Load Testers
Web Scrapers
Chat Servers (obviously)
Jump in, the water’s fine