Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Phoenix for Rubyists
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Doug Goldie
August 26, 2018
Programming
36
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Phoenix for Rubyists
Introduction to Elixir and Phoenix
Doug Goldie
August 26, 2018
Transcript
39 slides
Phoenix for Rubyists Concurrency and Scalability with Productivity by Doug
Goldie Code Cauldron
Bunny Trails Learning something new…. Why are you here?
New Language/Framework Scalability Concurrency Multicore machines Productivity of Rails
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.
What do we build? Any Web Applications Distributed Systems But
we still want productivity
Today Phoenix Elixir Erlang
Web Applications Classic CRUD monolith Single page app (SPA) -
with any frontend Realtime app productivity and performance.
Distributed Systems Large-Scale distributed, fault-tolerant system Phoenix as the Web
component Elixir for the other components. Small distributed apps. productivity and performance.
Agenda Elixir in 10 minutes Basic Phoenix app Real-time app
Distributed systems Some really contrarian, disruptive ideas !!
Elixir
Elixir in 10 minutes placeholder
Basic Web Application
Phoenix demo Classic Rails example
Real-time Application
Real-time Features Phoenix Channels Topics Elixir & Erlang Massive concurrency
Actor model Processes
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
None
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/
Distributed Systems
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
None
Hard Problem to Solve
with only 10 engineers! In 2014, sold for $19 Billion.
465 million users 550 servers
Erlang History Developed over 25 years ago by Ericsson for
building Telcom products Released as open source in 1998.
Requirements • high concurrency • distribution • fault tolerant •
soft realtime • high availability • external interfaces • hot code upgrade
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
Scheduler
OTP Library of Design Patterns Behaviors Client Server Supervisors and
Workers
Gen Server
Lifecycle of GenServer
Fault-tolerance
None
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”
Umbrella demo Phoenix and Elixir have Umbrella apps. Separate Applications
in one repo.
Disruptive Ideas Service-Oriented Architectures MicroServices Web Services: json Front-end Frameworks?
Are there better ways?
Review
Erlang review • massive concurrency • Processes • OTP •
Virtual Machine (BEAM)
Elixir review • BEAM (Erlang VM) • modern syntax •
macros • tooling • community • documentation
Phoenix review • pipelines • changesets • contexts • channels/topics
• umbrella apps
More Decks by Doug Goldie
See All by Doug Goldie
Phoenix for Rubyists with notes
dgoldie
0
45
Other Decks in Programming
See All in Programming
ruby/uri meets WHATWG
jinroq
0
190
Datadog を OTel にするメリットを考察する — Datadog との併用を実アプリで確かめる / Examining the Benefits of Moving Datadog to OTel — Testing OTel Alongside Datadog in a Real App
seike460
PRO
1
120
止まらない比較を止める — 余帰納法で無限ストリームを比べる
tarao
0
220
baseline으로 마이그레이션, 리팩토링 안전하게 맡기기
fornewid
1
1.1k
マルチプロダクトSaaSの アプリ一覧を速くする——複数プロダクトにまたがる「権限行脚」を減らすまで #techramen26conf
mktakuya
1
270
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
470
SODA - FACT BOOK(JP)
sodainc
1
40k
例外からRich Errorsまで Kotlinエラーハンドリングの進化を読み解く
shiita0903
0
260
はじめてのPLATEAU
nokonoko1203
1
680
Spec-driven Development with AI
simas
PRO
0
2.3k
Distance field of Julia set
kinakomoti321
0
340
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
330
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.4k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
410
Claude Code のすすめ
schroneko
67
230k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
2
4.1k
Un-Boring Meetings
codingconduct
0
520
Chasing Engaging Ingredients in Design
codingconduct
0
410
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
710
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7.1k
The SEO identity crisis: Don't let AI make you average
varn
0
630
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Embracing the Ebb and Flow
colly
88
5.2k