it is and why it matters Who is using it, and how • Elixir Why it is better than plain Erlang A tour of syntax • Phoenix Framework High level presentation Demo: rumbl • Bonus: Phoenix LiveView
Erlang was created at Ericsson in 1986. • The erlang is a unit of traffic density in a telecommunications system. • Erlang also stands for Ericsson Language
in memory store • Mnesia Distributed database based on ETS The Erlang OS distribution includes OTP, a set of libraries to build highly concurrent and distributed systems
League of Legends Chat servers • Call of Duty Multiplayer infrastructure • WhatsApp 900M users infra managed by 50 engineers 2 million connections on a single node
Discord 5M users with Erlang, 11M with Erlang + Rust • Heroku Router of their PaaS, plus other pieces • AXD-301 0.6 seconds of downtime in 20 years (!) Continuous Deployment with scp (!!!)
(1) Elixir: runs on the same runtime • Builds on top of Erlang OTP • Provides some abstractions to handle concurrency: GenServer, GenStages, Agents • Modern language features: mix, ExUnit, Hex Docs, macros (!), progressive typing, formatter…
(RESUMED) Elixir: runs on the same runtime • Builds on top of Erlang OTP • Provides some abstractions to handle concurrency: Tasks, GenServers, GenStages, Agents • Modern language features: mix, ExUnit, Hex Docs, macros (!), progressive typing, formatter…
think infinite loops • are independent • are location transparent • exchange messages • keep internal state Elixir is multiparadigm: this is OOP as envisioned by Alan Kay!
(2) • Borrows from different communities • Nice tooling for building web applications • Nice tooling for building IoT applications Phoenix Framework Nerves IoT Platform
(2) • Borrows from different communities • Nice tooling for building web applications • Nice tooling for building IoT applications Phoenix Framework Nerves IoT Platform
composable modules for connection management • Front and center of Phoenix HTTP layer • Functional approach to request handling: @spec create(Plug.Conn.t(), map) :: Plug.Conn.t()
and querying • Changesets: data validation • Schemas: ORM mapping • Query: composable DSL for SQL Migrations, Data Seeding • Sandbox: run integration tests agains the DB without worrying about data integrity
publish-subscribe mechanism • Channels: real time client-server communication • Presence: user presence tracking • LiveView: build real-time apps with only server side code GenServer PubSub Channels Presence LiveView
Programming Phoenix • Real Time Phoenix • Pragmatic Studio - Phoenix LiveView course • Elixir School • r/elixir reddit • Elixir forum • GOTO Conf 2019 - The Soul of Erlang and Elixir