SlideShare a Scribd company logo
1 of 82
{
Erlang and gen_fsm
@dieswaytoofast
(V.P. Ubiquiti Networks)
The Business
The Metrics
 Phone Calls per Second
The Metrics
 Phone Calls per Second
The Metrics
x 1000
 Simultaneous Phone Calls
The Metrics
 Simultaneous Phone Calls
The Metrics
x 10,000
 HTTP API requests
The Metrics
 HTTP API requests
The Metrics
x ∞
 Self-hosted (kinda)
 Voice Response
Call Handling
init
Setup Call
Get Caller
Name
Play Transfer
Message
Got Caller
Name
Dial
 Call Routing
Call Handling
dial_in
Check
Blacklist
get_endpoint conference Play Error
Hangupauto_attendant
dial_in_fml conference
init
Check node
Check
Blacklist
Cancelled Blacklisted Next Endpoint Collections Unknown
Move node
Auto Attendant FML Voicemail FaxConference
 Self-hosted (kinda)
Bet the farm moment
ERLANG!!!
 Concurrency
The Big Six
From http://www.erlang.org/download/armstrong_thesis_2003.pdf
 Concurrency
 Error encapsulation
The Big Six
From http://www.erlang.org/download/armstrong_thesis_2003.pdf
 Concurrency
 Error encapsulation
 Fault detection
The Big Six
From http://www.erlang.org/download/armstrong_thesis_2003.pdf
 Concurrency
 Error encapsulation
 Fault detection
 Fault identification
The Big Six
From http://www.erlang.org/download/armstrong_thesis_2003.pdf
 Concurrency
 Error encapsulation
 Fault detection
 Fault identification
 Code upgrade
The Big Six
From http://www.erlang.org/download/armstrong_thesis_2003.pdf
 Concurrency
 Error encapsulation
 Fault detection
 Fault identification
 Code upgrade
 Stable Storage
The Big Six
From http://www.erlang.org/download/armstrong_thesis_2003.pdf
Erlang
Concurrency Hell
My Blue Heaven My Blue Heaven
Erlang
Concurrency Hell
My Blue Heaven
Deep Problems
My Blue Heaven
Deep Problems
 gen_server
Behaviours
 gen_server
 gen_tcp
Behaviours
 gen_server
 gen_tcp
 gen_event
Behaviours
 gen_server
 gen_tcp
 gen_event
 gen_fsm
Behaviours
 gen_server
 gen_tcp
 gen_event
 gen_fsm
 …
Behaviours
 gen_server
 gen_tcp
 gen_event
 gen_fsm
 …
Behaviours
 A System has States
Finite State Machines
asleepStart
out of
bed
Coffee!!
 A System has States
 States transition
Finite State Machines
asleepStart
out of
bed
Coffee!!
 A System has States
 States transition
 Transitions are Atomic
Finite State Machines
asleepStart
out of
bed
Coffee!!
NOTHING HERE
 A System has States
 States transition
 Transitions are Atomic
 Events at Entry and Exit
Finite State Machines
asleepStart
out of
bed
Riiiiiiiiing Brush Teeth
Coffee!!
asleepStart
out of
bed
Coffee!!
asleepStart
out of
bed
Riiiiiiiiing Brush Teeth
Coffee!!
asleepStart
out of
bed
Riiiiiiiiing Brush Teeth
Coffee!!
asleepStart
out of
bed
Coffee!!
asleepStart
out of
bed
Riiiiiiiiing Brush Teeth
Coffee!!
HUH?
asleepStart
out of
bed
Riiiiiiiiing Brush Teeth
Coffee!!
asleepStart
out of
bed
Riiiiiiiiing Brush Teeth
Coffee!!
W
00t!
Un-
Auth
Start
Token
Req.
Stop
Un-
Auth
Start
Token
Req.
Stop
Get
Request
Token
Get
Access
Token
Request
Token
Access
Token
Un-
Auth
Start
Token
Req.
Stop
Get
Request
Token
Get
Access
Token
Request
Token
Access
Token
Un-
Auth
Start
Token
Req.
Stop
Get
Request
Token
Get
Access
Token
Request
Token
Access
Token
Un-
Auth
Start
Token
Req.
Stop
Get
Request
Token
Get
Access
Token
Request
Token
Access
Token
Un-
Auth
Start
Token
Req.
Stop
Get
Request
Token
Get
Access
Token
Request
Token
Access
Token
Un-
Auth
Start
Token
Req.
Stop
Get
Request
Token
Get
Access
Token
Request
Token
Access
Token
Un-
Auth
Start
Token
Req.
Stop
Get
Request
Token
Get
Access
Token
Request
Token
Access
Token
Un-
Auth
Start
Token
Req.
Stop
Get
Request
Token
Get
Access
Token
Request
Token
Access
Token
 Everything is an FSM
Finite State Machines
 Everything is an FSM
Finite State Machines
COM
PLEXITY?
 Everything is an FSM
Finite State Machines
ENCAPSULATION!
 Voice Response
Finite State Machines
init
Setup Call
Get Caller
Name
Play Transfer
Message
Got Caller
Name
Dial
 Voice Response
Finite State Machines
init
Setup Call
Get Caller
Name
Play Transfer
Message
Got Caller
Name
Dial
 Voice Response
Finite State Machines
init
Setup Call
Get Caller
Name
Play Transfer
Message
Got Caller
Name
Dial
ENCAPSULATION!
Encapsulation
Concurrency Hell
My Blue Heaven
Deep Problems
My Blue Heaven
Deep Problems
 Call Routing
Finite State Machines
dial_in
Check
Blacklist
get_endpoint conference Play Error
Hangupauto_attendant
dial_in_fml conference
init
Check node
Check
Blacklist
Cancelled Blacklisted Next Endpoint Collections Unknown
Move node
Auto Attendant FML Voicemail FaxConference
 Templates are your friend
 So are BIG sheets of paper
 Think “Real World”
The Bottom Line
Finite State Machines - Why the fear?

More Related Content

Viewers also liked

Temática del blog
Temática del blogTemática del blog
Temática del blogmmartinez126
 
Capítulo 4 libro zacatollan una hist... copia
Capítulo 4 libro zacatollan una hist...   copiaCapítulo 4 libro zacatollan una hist...   copia
Capítulo 4 libro zacatollan una hist... copiaCesar Adame
 
NUBE ELECTRÓNICA
NUBE ELECTRÓNICANUBE ELECTRÓNICA
NUBE ELECTRÓNICALUISRUBINOS
 
Untitled presentation
Untitled presentationUntitled presentation
Untitled presentationjuantoro527
 
Presentacion enviroo institucional_abril2012
Presentacion enviroo institucional_abril2012Presentacion enviroo institucional_abril2012
Presentacion enviroo institucional_abril2012enviroo
 
Mito ediporeyequipo2
Mito ediporeyequipo2Mito ediporeyequipo2
Mito ediporeyequipo2CARMENALBAMTZ
 
Curso comunicación y marketing
Curso comunicación y marketingCurso comunicación y marketing
Curso comunicación y marketingAPFOS
 
Clase demostrativa
Clase demostrativaClase demostrativa
Clase demostrativaLeo Tuqueres
 
Kiss and say.....pps by d.
Kiss and say.....pps by d.Kiss and say.....pps by d.
Kiss and say.....pps by d.D. Ynoche
 

Viewers also liked (16)

Temática del blog
Temática del blogTemática del blog
Temática del blog
 
Marlon ernesto
Marlon ernestoMarlon ernesto
Marlon ernesto
 
Emprendimiento pg 59
Emprendimiento pg 59Emprendimiento pg 59
Emprendimiento pg 59
 
Capítulo 4 libro zacatollan una hist... copia
Capítulo 4 libro zacatollan una hist...   copiaCapítulo 4 libro zacatollan una hist...   copia
Capítulo 4 libro zacatollan una hist... copia
 
NUBE ELECTRÓNICA
NUBE ELECTRÓNICANUBE ELECTRÓNICA
NUBE ELECTRÓNICA
 
Untitled presentation
Untitled presentationUntitled presentation
Untitled presentation
 
Presentacion enviroo institucional_abril2012
Presentacion enviroo institucional_abril2012Presentacion enviroo institucional_abril2012
Presentacion enviroo institucional_abril2012
 
Precio
PrecioPrecio
Precio
 
Mito ediporeyequipo2
Mito ediporeyequipo2Mito ediporeyequipo2
Mito ediporeyequipo2
 
La guitarra
La guitarraLa guitarra
La guitarra
 
ORACIONES AL PADRE
ORACIONES AL PADREORACIONES AL PADRE
ORACIONES AL PADRE
 
web 1.0 vs web 2.0
web 1.0 vs web 2.0web 1.0 vs web 2.0
web 1.0 vs web 2.0
 
12 errores con hijos
12 errores con hijos12 errores con hijos
12 errores con hijos
 
Curso comunicación y marketing
Curso comunicación y marketingCurso comunicación y marketing
Curso comunicación y marketing
 
Clase demostrativa
Clase demostrativaClase demostrativa
Clase demostrativa
 
Kiss and say.....pps by d.
Kiss and say.....pps by d.Kiss and say.....pps by d.
Kiss and say.....pps by d.
 

More from OSCON Byrum

OSCON 2013 - Planning an OpenStack Cloud - Tom Fifield
OSCON 2013 - Planning an OpenStack Cloud - Tom FifieldOSCON 2013 - Planning an OpenStack Cloud - Tom Fifield
OSCON 2013 - Planning an OpenStack Cloud - Tom FifieldOSCON Byrum
 
Protecting Open Innovation with the Defensive Patent License
Protecting Open Innovation with the Defensive Patent LicenseProtecting Open Innovation with the Defensive Patent License
Protecting Open Innovation with the Defensive Patent LicenseOSCON Byrum
 
Using Cascalog to build an app with City of Palo Alto Open Data
Using Cascalog to build an app with City of Palo Alto Open DataUsing Cascalog to build an app with City of Palo Alto Open Data
Using Cascalog to build an app with City of Palo Alto Open DataOSCON Byrum
 
How we built our community using Github - Uri Cohen
How we built our community using Github - Uri CohenHow we built our community using Github - Uri Cohen
How we built our community using Github - Uri CohenOSCON Byrum
 
The Vanishing Pattern: from iterators to generators in Python
The Vanishing Pattern: from iterators to generators in PythonThe Vanishing Pattern: from iterators to generators in Python
The Vanishing Pattern: from iterators to generators in PythonOSCON Byrum
 
Distributed Coordination with Python
Distributed Coordination with PythonDistributed Coordination with Python
Distributed Coordination with PythonOSCON Byrum
 
An overview of open source in East Asia (China, Japan, Korea)
An overview of open source in East Asia (China, Japan, Korea)An overview of open source in East Asia (China, Japan, Korea)
An overview of open source in East Asia (China, Japan, Korea)OSCON Byrum
 
Oscon 2013 Jesse Anderson
Oscon 2013 Jesse AndersonOscon 2013 Jesse Anderson
Oscon 2013 Jesse AndersonOSCON Byrum
 
US Patriot Act OSCON2012 David Mertz
US Patriot Act OSCON2012 David MertzUS Patriot Act OSCON2012 David Mertz
US Patriot Act OSCON2012 David MertzOSCON Byrum
 
OSCON 2012 US Patriot Act Implications for Cloud Computing - Diane Mueller, A...
OSCON 2012 US Patriot Act Implications for Cloud Computing - Diane Mueller, A...OSCON 2012 US Patriot Act Implications for Cloud Computing - Diane Mueller, A...
OSCON 2012 US Patriot Act Implications for Cloud Computing - Diane Mueller, A...OSCON Byrum
 
Big Data for each one of us
Big Data for each one of usBig Data for each one of us
Big Data for each one of usOSCON Byrum
 
BodyTrack: Open Source Tools for Health Empowerment through Self-Tracking
BodyTrack: Open Source Tools for Health Empowerment through Self-Tracking BodyTrack: Open Source Tools for Health Empowerment through Self-Tracking
BodyTrack: Open Source Tools for Health Empowerment through Self-Tracking OSCON Byrum
 
Declarative web data visualization using ClojureScript
Declarative web data visualization using ClojureScriptDeclarative web data visualization using ClojureScript
Declarative web data visualization using ClojureScriptOSCON Byrum
 
Using and Building Open Source in Google Corporate Engineering - Justin McWil...
Using and Building Open Source in Google Corporate Engineering - Justin McWil...Using and Building Open Source in Google Corporate Engineering - Justin McWil...
Using and Building Open Source in Google Corporate Engineering - Justin McWil...OSCON Byrum
 
A Look at the Network: Searching for Truth in Distributed Applications
A Look at the Network: Searching for Truth in Distributed ApplicationsA Look at the Network: Searching for Truth in Distributed Applications
A Look at the Network: Searching for Truth in Distributed ApplicationsOSCON Byrum
 
Life After Sharding: Monitoring and Management of a Complex Data Cloud
Life After Sharding: Monitoring and Management of a Complex Data CloudLife After Sharding: Monitoring and Management of a Complex Data Cloud
Life After Sharding: Monitoring and Management of a Complex Data CloudOSCON Byrum
 
Faster! Faster! Accelerate your business with blazing prototypes
Faster! Faster! Accelerate your business with blazing prototypesFaster! Faster! Accelerate your business with blazing prototypes
Faster! Faster! Accelerate your business with blazing prototypesOSCON Byrum
 
Comparing open source private cloud platforms
Comparing open source private cloud platformsComparing open source private cloud platforms
Comparing open source private cloud platformsOSCON Byrum
 
State of the Art Web Mapping with Open Source
State of the Art Web Mapping with Open SourceState of the Art Web Mapping with Open Source
State of the Art Web Mapping with Open SourceOSCON Byrum
 
Building an Ecosystem of FLOSS to Educate Students with Disabilities
Building an Ecosystem of FLOSS to Educate Students with DisabilitiesBuilding an Ecosystem of FLOSS to Educate Students with Disabilities
Building an Ecosystem of FLOSS to Educate Students with DisabilitiesOSCON Byrum
 

More from OSCON Byrum (20)

OSCON 2013 - Planning an OpenStack Cloud - Tom Fifield
OSCON 2013 - Planning an OpenStack Cloud - Tom FifieldOSCON 2013 - Planning an OpenStack Cloud - Tom Fifield
OSCON 2013 - Planning an OpenStack Cloud - Tom Fifield
 
Protecting Open Innovation with the Defensive Patent License
Protecting Open Innovation with the Defensive Patent LicenseProtecting Open Innovation with the Defensive Patent License
Protecting Open Innovation with the Defensive Patent License
 
Using Cascalog to build an app with City of Palo Alto Open Data
Using Cascalog to build an app with City of Palo Alto Open DataUsing Cascalog to build an app with City of Palo Alto Open Data
Using Cascalog to build an app with City of Palo Alto Open Data
 
How we built our community using Github - Uri Cohen
How we built our community using Github - Uri CohenHow we built our community using Github - Uri Cohen
How we built our community using Github - Uri Cohen
 
The Vanishing Pattern: from iterators to generators in Python
The Vanishing Pattern: from iterators to generators in PythonThe Vanishing Pattern: from iterators to generators in Python
The Vanishing Pattern: from iterators to generators in Python
 
Distributed Coordination with Python
Distributed Coordination with PythonDistributed Coordination with Python
Distributed Coordination with Python
 
An overview of open source in East Asia (China, Japan, Korea)
An overview of open source in East Asia (China, Japan, Korea)An overview of open source in East Asia (China, Japan, Korea)
An overview of open source in East Asia (China, Japan, Korea)
 
Oscon 2013 Jesse Anderson
Oscon 2013 Jesse AndersonOscon 2013 Jesse Anderson
Oscon 2013 Jesse Anderson
 
US Patriot Act OSCON2012 David Mertz
US Patriot Act OSCON2012 David MertzUS Patriot Act OSCON2012 David Mertz
US Patriot Act OSCON2012 David Mertz
 
OSCON 2012 US Patriot Act Implications for Cloud Computing - Diane Mueller, A...
OSCON 2012 US Patriot Act Implications for Cloud Computing - Diane Mueller, A...OSCON 2012 US Patriot Act Implications for Cloud Computing - Diane Mueller, A...
OSCON 2012 US Patriot Act Implications for Cloud Computing - Diane Mueller, A...
 
Big Data for each one of us
Big Data for each one of usBig Data for each one of us
Big Data for each one of us
 
BodyTrack: Open Source Tools for Health Empowerment through Self-Tracking
BodyTrack: Open Source Tools for Health Empowerment through Self-Tracking BodyTrack: Open Source Tools for Health Empowerment through Self-Tracking
BodyTrack: Open Source Tools for Health Empowerment through Self-Tracking
 
Declarative web data visualization using ClojureScript
Declarative web data visualization using ClojureScriptDeclarative web data visualization using ClojureScript
Declarative web data visualization using ClojureScript
 
Using and Building Open Source in Google Corporate Engineering - Justin McWil...
Using and Building Open Source in Google Corporate Engineering - Justin McWil...Using and Building Open Source in Google Corporate Engineering - Justin McWil...
Using and Building Open Source in Google Corporate Engineering - Justin McWil...
 
A Look at the Network: Searching for Truth in Distributed Applications
A Look at the Network: Searching for Truth in Distributed ApplicationsA Look at the Network: Searching for Truth in Distributed Applications
A Look at the Network: Searching for Truth in Distributed Applications
 
Life After Sharding: Monitoring and Management of a Complex Data Cloud
Life After Sharding: Monitoring and Management of a Complex Data CloudLife After Sharding: Monitoring and Management of a Complex Data Cloud
Life After Sharding: Monitoring and Management of a Complex Data Cloud
 
Faster! Faster! Accelerate your business with blazing prototypes
Faster! Faster! Accelerate your business with blazing prototypesFaster! Faster! Accelerate your business with blazing prototypes
Faster! Faster! Accelerate your business with blazing prototypes
 
Comparing open source private cloud platforms
Comparing open source private cloud platformsComparing open source private cloud platforms
Comparing open source private cloud platforms
 
State of the Art Web Mapping with Open Source
State of the Art Web Mapping with Open SourceState of the Art Web Mapping with Open Source
State of the Art Web Mapping with Open Source
 
Building an Ecosystem of FLOSS to Educate Students with Disabilities
Building an Ecosystem of FLOSS to Educate Students with DisabilitiesBuilding an Ecosystem of FLOSS to Educate Students with Disabilities
Building an Ecosystem of FLOSS to Educate Students with Disabilities
 

Recently uploaded

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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 WoodJuan lago vázquez
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
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 FresherRemote DBA Services
 
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
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
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 educationjfdjdjcjdnsjd
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
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
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 

Finite State Machines - Why the fear?

Editor's Notes

  1. So, I started a phone company. It was a great thing. Phones make people happy, right?
  2. Yeah. Kids. Don’t do this at home. Don’t start a phone company.
  3. But I did. Hosted phone services for SMBs. Vonage for small businesses. In the cloud. Awesome
  4. 3 orders of magnitude
  5. 4 orders of magnitude
  6. Infinity!
  7. Houston – we have a problem
  8. Consider the simplest case of handling a call
  9. It actually gets a lot more complex
  10. And eventually, a *lot* more complex
  11. To put it differently,It was a “bet the farm” moment
  12. And it basically involved a lot of beer
  13. And we rewrote the whole damn thing in Erlang. WhyErlang? Well, Fault Tolerance, basicallyAnd oh, I’m not putting Kirk up there. That’s too obvious.
  14. The Six Essential Characteristics of a Fault Tolerant System
  15. The Six Essential Characteristics of a Fault Tolerant System
  16. The Six Essential Characteristics of a Fault Tolerant System
  17. The Six Essential Characteristics of a Fault Tolerant System
  18. The Six Essential Characteristics of a Fault Tolerant System
  19. The Six Essential Characteristics of a Fault Tolerant System
  20. ‘Distributed’ problems mean you spend a huge chunk of your time dealing with theadminstrivia of distribution.With erlang you get that for free!
  21. Ok, not really true. You still have to deal with ‘deep problems’ (hard core parallelization issues, etc.)But you’d have to deal with that anyhow!
  22. Implement the server part of a client/server relationship
  23. Talk to tcp over sockets
  24. Event handling
  25. Finite state machines
  26. And a bunch more (gen_udp, gen_utp!, etc.)
  27. But, we’re talking about Finite State Machines
  28. Lets talk about FSMs
  29. Putting this into practice, here is some code
  30. A system has states
  31. When certain events show up
  32. You do something
  33. And transition to the next state
  34. Wait, WHUT? Where did the “events” come from?
  35. I’m glad you asked  more code
  36. And thusly an event is sent
  37. Voila, an ErlangFSM
  38. 2.0 is anightmare; Stick w/ 1.0
  39. A system has states
  40. Events and transitions
  41. The code
  42. The states
  43. When you receive an event
  44. try to do something
  45. If it works go to the next state
  46. If it fails, go to a differen state
  47. Thusly
  48. And now for the events
  49. But wait! What if you walk out partway?
  50. So, a wee bit triclyhere -
  51. We have a timeout
  52. And it tells you where to go after the timeout
  53. And, you’re done.
  54. Lets look at this as a ‘real world” thingy
  55. But, you say, BUT, what about the complexity of dealing with FSMs? They’re big! And unweildy!
  56. Nah. They aren’t. Not in Erlang
  57. Remember this? It was a PITA? Actually, a small part of a PITA?
  58. But each one is tightly encapsulated, and clean.It’s the Erlang Way
  59. But each one is tightly encapsulated, and clean.It’s the Erlang Way
  60. My fanciful slides are actually real. This actually happens.
  61. And it’s the same for everything else I showed. FSMs of FSMs.
  62. An FSM of FSMs of FSMsBuilding these out “correctly”, in real time, is (was!) trivial
  63. “Real World”  Business Rules can help. (VM,syncrhonziation)