SlideShare ist ein Scribd-Unternehmen logo
1 von 51
Downloaden Sie, um offline zu lesen
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 ;)

Weitere ähnliche Inhalte

Ähnlich wie Phoenix Framework for the realtime web

Eugene Letuchy Erlangat Facebook
Eugene Letuchy Erlangat FacebookEugene Letuchy Erlangat Facebook
Eugene Letuchy Erlangat Facebook
Dario Salvelli
 
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
ITCamp
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Phoenix Framework for the realtime web