SlideShare une entreprise Scribd logo
1  sur  51
Télécharger pour lire hors ligne
Phoenix Framework for the
realtime web
Pedro Medeiros
Summary
Summary
● Erlang model
● Brief Elixir
● Phoenix motivation
● Phoenix Channels
Erlang
● Created in 1986
● Solves a specific Hard problem at the time
● Limited Resources
● In Brief
○ Fault-Tolerance
○ High Disponibility
○ Concurrent Oriented
Switch
Switch
phones
Erlang
● Achievements
○ No shared state concurrency focused
○ Live code reloading
○ Clustering through message passing (Actor
Model)
○ High Availability 99.9999999 % (nine Nines)
○ Used in GPRS, 3G and LTE networks worldwide
Erlang
Switch
Switch
phones
Server
Browser
App
IoT
Endpoints
2 Million connections on a single node
https://blog.whatsapp.com/196/1-million-is-so-2011?
Erlang
Fibonacci example:
Erlang
World Counter example:
Elixir
● Functional Programming language.
● On top of Erlang VM
● Immutable structures
● Concurrent
● Distributed
● Fault Tolerant
Elixir
● Design Goals
○ Extensibility
○ Productivity
○ Compatibility
Elixir
● Extensibility
○ Ad hoc Polymorphism (data type)
○ Strict and lazy enumeration APIs
○ Macros for metaprogramming
● Macros
Elixir
● Macros
Elixir
Elixir
● Productivity
○ Out of the box tools to startup a project
○ Nice syntax for test and documentation
○ Easy to distribute and to create libs
● Testing asserts
Elixir
Elixir
● Compatibility
○ Compiles to ErlangVM
○ Elixir runs Erlang code Erlang runs Elixir code
○ Community grown
● Calling Erlang
from elixir
● Calling Elixir
from Erlang
Elixir
● Exchange Code
between those
two.
Elixir
Disclaimer
Elixir is not about a better
syntax for the Erlang VM
2 Million connections on a single node
https://blog.whatsapp.com/196/1-million-is-so-2011?
Phoenix
● Started with Phoenix Channels
○ Inspired by the whatsapp case
○ Real time communication
○ Beyond browsers (native apps and IoTs)
Phoenix
Easy Abstraction in javascript
Phoenix
Simple Backend code
Server
Server
Browser
Native
IoTs
Phoenix
PubSub
Phoenix
client server
Channels
socket.connect()
Distributed Erlang
Redis
Postgres?
XMPP?
- Isolated
- Concurrent
The road to 2 million
connections
○ 40 core 128 gb Rack space machine
○ Accomplish it with minor changes.
Phoenix
http://www.phoenixframework.org/blog/the-road-to-2-million-websocket-connections
Phoenix
The road to 2 million connections
Phoenix Benchmarks
"There are three kinds of lies: lies, damned lies, and statistics."
- Clarisse Linspector
Phoenix Benchmarks
$ wrk -t20 -c100 -d30s --timeout 2000
https://github.com/mroth/phoenix-showdown
Library Throughput (req/s) Latency (m/s)
Plug (elixir) 198 328 0.63
Phoenix (elixir) 179 685 0.61
Gin (go) 176 156 0.65
Play (scala) 171 236 1.89
Express Cluster (node) 92 064 1.24
Martini (go) 32 077 3.35
Sinatra (ruby) 30 561 3.50
Rails (ruby) 11 903 8.50
Phoenix
client server
/index
/permissions
/settings
- Isolated
- Concurent
Productivity
Short term productivity
vs
Long term productivity
Short term productivity
● Great documentation as first class citizen
● Guides
● Code generators (as a learning tool)
○ mix phx.gen.html
○ mix phx.gen.json
○ mix phx.gen.channel
Short term productivity
● HTML Form Builders
● Great live code reloading
● Assets build tools with ES6 as default
● Pretty error pages
● First Class concurrent test tools
Long term productivity
● OTP Applications
○ Functional Programming
○ Introspection
○ Monitoring
○ Fault Tolerant
○ Supervisors
○ Visibility of application state
Long term productivity
Wrapping up
Thanks ;)

Contenu connexe

Similaire à Phoenix Framework for the realtime web

Elixir Phoenix
Elixir PhoenixElixir Phoenix
Elixir PhoenixTanuj Soni
 
The Next Leap in JavaScript Performance
The Next Leap in JavaScript PerformanceThe Next Leap in JavaScript Performance
The Next Leap in JavaScript PerformanceIntel® Software
 
Edge Computing: A Unified Infrastructure for all the Different Pieces
Edge Computing: A Unified Infrastructure for all the Different PiecesEdge Computing: A Unified Infrastructure for all the Different Pieces
Edge Computing: A Unified Infrastructure for all the Different PiecesCloudify Community
 
OSCON: System software goes weird
OSCON: System software goes weirdOSCON: System software goes weird
OSCON: System software goes weirdDocker, Inc.
 
What is Software Development by Thesys Tech Head of Development
What is Software Development by Thesys Tech Head of DevelopmentWhat is Software Development by Thesys Tech Head of Development
What is Software Development by Thesys Tech Head of DevelopmentProduct School
 
100G Networking Berlin.pdf
100G Networking Berlin.pdf100G Networking Berlin.pdf
100G Networking Berlin.pdfJunZhao68
 
Pristine glif 2015
Pristine glif 2015Pristine glif 2015
Pristine glif 2015ICT PRISTINE
 
Unikraft: Fast, Specialized Unikernels the Easy Way
Unikraft: Fast, Specialized Unikernels the Easy WayUnikraft: Fast, Specialized Unikernels the Easy Way
Unikraft: Fast, Specialized Unikernels the Easy WayScyllaDB
 
Eugene Letuchy Erlangat Facebook
Eugene Letuchy Erlangat FacebookEugene Letuchy Erlangat Facebook
Eugene Letuchy Erlangat FacebookDario Salvelli
 
Superfluid Deployment of Virtual Functions: Exploiting Mobile Edge Computing ...
Superfluid Deployment of Virtual Functions: Exploiting Mobile Edge Computing ...Superfluid Deployment of Virtual Functions: Exploiting Mobile Edge Computing ...
Superfluid Deployment of Virtual Functions: Exploiting Mobile Edge Computing ...Stefano Salsano
 
XML Amsterdam 2012 Keynote
XML Amsterdam 2012 KeynoteXML Amsterdam 2012 Keynote
XML Amsterdam 2012 Keynotejimfuller2009
 
PLNOG 17 - Nicolai van der Smagt - Building and connecting the eBay Classifie...
PLNOG 17 - Nicolai van der Smagt - Building and connecting the eBay Classifie...PLNOG 17 - Nicolai van der Smagt - Building and connecting the eBay Classifie...
PLNOG 17 - Nicolai van der Smagt - Building and connecting the eBay Classifie...PROIDEA
 
ITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep dive
ITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep diveITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep dive
ITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep diveITCamp
 
Extending the Yahoo Streaming Benchmark + MapR Benchmarks
Extending the Yahoo Streaming Benchmark + MapR BenchmarksExtending the Yahoo Streaming Benchmark + MapR Benchmarks
Extending the Yahoo Streaming Benchmark + MapR BenchmarksJamie Grier
 
Elm & Elixir: Functional Programming and Web
Elm & Elixir: Functional Programming and WebElm & Elixir: Functional Programming and Web
Elm & Elixir: Functional Programming and WebPublitory
 
Internet Of Things: Hands on: YOW! night
Internet Of Things: Hands on: YOW! nightInternet Of Things: Hands on: YOW! night
Internet Of Things: Hands on: YOW! nightAndy Gelme
 
Angular2 - A story from the trenches
Angular2 - A story from the trenchesAngular2 - A story from the trenches
Angular2 - A story from the trenchesJohannes Rudolph
 
Smalltalk XXL
Smalltalk XXLSmalltalk XXL
Smalltalk XXLESUG
 

Similaire à Phoenix Framework for the realtime web (20)

Elixir Phoenix
Elixir PhoenixElixir Phoenix
Elixir Phoenix
 
The Next Leap in JavaScript Performance
The Next Leap in JavaScript PerformanceThe Next Leap in JavaScript Performance
The Next Leap in JavaScript Performance
 
Edge Computing: A Unified Infrastructure for all the Different Pieces
Edge Computing: A Unified Infrastructure for all the Different PiecesEdge Computing: A Unified Infrastructure for all the Different Pieces
Edge Computing: A Unified Infrastructure for all the Different Pieces
 
OSCON: System software goes weird
OSCON: System software goes weirdOSCON: System software goes weird
OSCON: System software goes weird
 
What is Software Development by Thesys Tech Head of Development
What is Software Development by Thesys Tech Head of DevelopmentWhat is Software Development by Thesys Tech Head of Development
What is Software Development by Thesys Tech Head of Development
 
100G Networking Berlin.pdf
100G Networking Berlin.pdf100G Networking Berlin.pdf
100G Networking Berlin.pdf
 
Pristine glif 2015
Pristine glif 2015Pristine glif 2015
Pristine glif 2015
 
Unikraft: Fast, Specialized Unikernels the Easy Way
Unikraft: Fast, Specialized Unikernels the Easy WayUnikraft: Fast, Specialized Unikernels the Easy Way
Unikraft: Fast, Specialized Unikernels the Easy Way
 
Eugene Letuchy Erlangat Facebook
Eugene Letuchy Erlangat FacebookEugene Letuchy Erlangat Facebook
Eugene Letuchy Erlangat Facebook
 
Superfluid Deployment of Virtual Functions: Exploiting Mobile Edge Computing ...
Superfluid Deployment of Virtual Functions: Exploiting Mobile Edge Computing ...Superfluid Deployment of Virtual Functions: Exploiting Mobile Edge Computing ...
Superfluid Deployment of Virtual Functions: Exploiting Mobile Edge Computing ...
 
XML Amsterdam 2012 Keynote
XML Amsterdam 2012 KeynoteXML Amsterdam 2012 Keynote
XML Amsterdam 2012 Keynote
 
Phoenix: Sent 200 OK in 3 μs
Phoenix: Sent 200 OK in 3 μsPhoenix: Sent 200 OK in 3 μs
Phoenix: Sent 200 OK in 3 μs
 
PLNOG 17 - Nicolai van der Smagt - Building and connecting the eBay Classifie...
PLNOG 17 - Nicolai van der Smagt - Building and connecting the eBay Classifie...PLNOG 17 - Nicolai van der Smagt - Building and connecting the eBay Classifie...
PLNOG 17 - Nicolai van der Smagt - Building and connecting the eBay Classifie...
 
ITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep dive
ITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep diveITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep dive
ITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep dive
 
Extending the Yahoo Streaming Benchmark + MapR Benchmarks
Extending the Yahoo Streaming Benchmark + MapR BenchmarksExtending the Yahoo Streaming Benchmark + MapR Benchmarks
Extending the Yahoo Streaming Benchmark + MapR Benchmarks
 
Elm & Elixir: Functional Programming and Web
Elm & Elixir: Functional Programming and WebElm & Elixir: Functional Programming and Web
Elm & Elixir: Functional Programming and Web
 
Erlang/Elixir and OTP
Erlang/Elixir and OTPErlang/Elixir and OTP
Erlang/Elixir and OTP
 
Internet Of Things: Hands on: YOW! night
Internet Of Things: Hands on: YOW! nightInternet Of Things: Hands on: YOW! night
Internet Of Things: Hands on: YOW! night
 
Angular2 - A story from the trenches
Angular2 - A story from the trenchesAngular2 - A story from the trenches
Angular2 - A story from the trenches
 
Smalltalk XXL
Smalltalk XXLSmalltalk XXL
Smalltalk XXL
 

Dernier

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 

Dernier (20)

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 

Phoenix Framework for the realtime web