Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Phoenix for Rubyists

Phoenix for Rubyists

Introduction to Elixir and Phoenix

Avatar for Doug Goldie

Doug Goldie

August 26, 2018
Tweet

More Decks by Doug Goldie

Other Decks in Programming

Transcript

  1. Moore’s Law is Dead! number of transistors in a dense

    integrated circuit doubles approximately every two years. We are seeing more multi-core machines with more cores.
  2. Web Applications Classic CRUD monolith Single page app (SPA) -

    with any frontend Realtime app productivity and performance.
  3. Distributed Systems Large-Scale distributed, fault-tolerant system Phoenix as the Web

    component Elixir for the other components. Small distributed apps. productivity and performance.
  4. Agenda Elixir in 10 minutes Basic Phoenix app Real-time app

    Distributed systems Some really contrarian, disruptive ideas !!
  5. Processes • lightweight, small memory, fast to create and terminate

    • message passing • no shared data • links and monitors • error handling Erlang is designed for massive concurrency
  6. Chat demo Classic real-time example Phoenix channels / topics presence

    http://work.stevegrossi.com/2016/07/11/building-a- chat-app-with-elixir-and-phoenix-presence/
  7. HTTP Server Nginx and Phusion Passenger Request processing Ruby on

    Rails Long-running requests Go Server-wide state Redis Persistable data Redis / MongoDB Background jobs Cron, Bash scripts, and Ruby Service crash recovery Upstart Erlang Erlang Erlang Erlang Erlang Erlang Erlang Server A Server B
  8. Erlang History Developed over 25 years ago by Ericsson for

    building Telcom products Released as open source in 1998.
  9. Requirements • high concurrency • distribution • fault tolerant •

    soft realtime • high availability • external interfaces • hot code upgrade
  10. Processes • lightweight, small memory, fast to create and terminate

    • message passing • no shared data • links and monitors • error handling Erlang is designed for massive concurrency
  11. Quotes “Best kept secret in software” 
 - Evan Miller,

    author of Chicago Boss “Erlang is about building Systems”
 - Robert Virding “Erlang makes the easy things hard 
 and the hard things easy”
  12. Elixir review • BEAM (Erlang VM) • modern syntax •

    macros • tooling • community • documentation