Practical Elixir through Phoenix

Exploring useful Elixir features and use cases, through using Phoenix

NO BOUNDRIES

Erlang? OTP? Elixir? Phoenix?

NO LAUNDRY LIST

It can do this, and it can do that!

NO SYNTAX

Well, just a little

Erlang

  • 2M connections
  • 400 million vs 30
  • 99.9...9% Uptime
  • Live code reload
  • Network transparency (kinda)
  • Benchmarks
  • Wait for it ...
  • https://blog.whatsapp.com/196/1-million-is-so-2011
  • http://stackoverflow.com/questions/8426897/erlangs-99-9999999-nine-nines-reliability
  • https://www.manning.com/books/elixir-in-action

Near-legendary stories

Deployment      Docker      Erlang
Monitoring/Debugging      Even more stuff      Erlang

Elixir

  • General purpose programming language
  • Erlang, Ruby, Clojure
  • Concurrent, Process-oriented, Functional
  • Everything is an Expression™
  • Young, clean, elixir

What Wikipedia has to say

https://en.wikipedia.org/wiki/Elixir_(programming_language)

Concurrency

  • OTP
  • Actor model
  • Shared Nothing™
  • Fair use
  • GC
  • Supervision tree
  • Distributed
  • BYOT
    • Erlport
    • NIF
    • Drivers (IPC)
    • Ports

en.wikipedia.org/wiki/Shared_nothing_architecture

erlport.org
erlang.org/doc/tutorial/introduction.html

github.com/koudelka/visualixir

Scalability

  • Vertical Scalability
  • Horizontal Scalability

Testing

  • Absolute must
  • Know your lingo
  • Simple DI

I will fight against mocks, stubs and YAML in Elixir with all my... friendliness and energy to promote proper education on those topics.

— José Valim (@josevalim)

https://gist.github.com/bcardarella/0c59378615779263798f

Misconceptions

  • Elixir isn't mature
  • Elixir is fast!
  • Elixir is complicated

Phoenix

  • use Elixir
  • RoR-inspired, without the baggage
  • Minimal, maintained, readable
  • Presence is coming
  • Let's look at ((-- Channels --))

Defacto elixir web framework

http://www.phoenixframework.org/

Channels

  • Websockets
  • Subscribe to topics
  • Client libraries in C#, Java, Swift, ... etc

Soft-realtime for the web

Demos

Taking a sip

Monitoring

NSA Certified

https://github.com/pinterest/elixometer

Distributed

Drooooooooooll

https://vimeo.com/53221562

GameServer

How Dama server works

  • Actor-based design
  • Erlang interoperability (erlport)
  • Bots and FSMs

RECAP

Productive

Fault Tolerant • Self-healing

Concurrent • Responsive

Scalable • Distributed

Immutable • Simple

Q&A

Practical Elixir, Through Phoenix

By mazyod

Practical Elixir, Through Phoenix

A practical introduction to Elixir, through exploring its use case as a web service.

  • 4,084