SlideShare a Scribd company logo
1 of 22
Actor Oriented Programming, Fault Tolerance and OTP Dhananjay Nene #devcamp pune  April 9 th , 2011
What is the Actor Model ?
“ In computer science, the Actor model is a mathematical model of  concurrent computation  that treats "actors" as the  universal primitives  of  concurrent digital computation : in response to a  message that it receives , an actor can make local decisions, create more actors, send more messages, and determine how to respond to the next message received.” –  Wikipedia (Actor Model)
Erlang Process Model
In erlang parlance, each actor is a process
However thats not the same as an operating system process. A single OS process hosts many erlang processes. An erlang process is far lighter than even a thread.
Isolation : Processes are isolated. They do not share any memory between themselves. Garbage collection also works independently per processes
Since processes run concurrently, the inability to share memory between them reduces many of the difficulties associated with conventional multi threaded programming
Messages : Processes interact with each other by sending each other messages asynchronously
For asynchronous messaging to work each process has a mailbox of messages and it processes one message at a time from the mailbox
Introduction : Sleeping Barber Problem
OTP : Open Telecom Platform
OTP plays a somewhat similar role as JEE does for Java
OTP Design Patterns : ,[object Object]
Server
Supervisor
State Machines
Event Handling
Philosophy : Let it crash
Let it crash actually encouraging higher availability initially seems like an oxymoron
But what it really emphasises is the ensured continued availability of the overall system rather than the robustness of every small piece that forms it.
So what features of erlang help fault tolerance?

More Related Content

Viewers also liked

Viewers also liked (12)

List of CrowdFunding Websites and much more!
List of CrowdFunding Websites and much more!List of CrowdFunding Websites and much more!
List of CrowdFunding Websites and much more!
 
GYANM GENERAL AWARENESS ISSUE JULY 2014
GYANM GENERAL AWARENESS ISSUE JULY 2014GYANM GENERAL AWARENESS ISSUE JULY 2014
GYANM GENERAL AWARENESS ISSUE JULY 2014
 
Who´s who in Spanish Wind Energy 2014
Who´s who in Spanish Wind Energy 2014Who´s who in Spanish Wind Energy 2014
Who´s who in Spanish Wind Energy 2014
 
Berlin
BerlinBerlin
Berlin
 
TCP/ IP
TCP/ IP TCP/ IP
TCP/ IP
 
Blackbox(englisch)
Blackbox(englisch)Blackbox(englisch)
Blackbox(englisch)
 
EPiServer Deployment Tips & Tricks
EPiServer Deployment Tips & TricksEPiServer Deployment Tips & Tricks
EPiServer Deployment Tips & Tricks
 
Jurnal lengkap Manajemen Dakwah UIN Jakarta Edisi I
Jurnal lengkap Manajemen Dakwah UIN Jakarta Edisi IJurnal lengkap Manajemen Dakwah UIN Jakarta Edisi I
Jurnal lengkap Manajemen Dakwah UIN Jakarta Edisi I
 
Trends in Technology
Trends in TechnologyTrends in Technology
Trends in Technology
 
Freenetlinks
FreenetlinksFreenetlinks
Freenetlinks
 
Security Issues in Android Custom ROM
Security Issues in Android Custom ROMSecurity Issues in Android Custom ROM
Security Issues in Android Custom ROM
 
Backlink iconia
Backlink iconiaBacklink iconia
Backlink iconia
 

Similar to Actors, Fault tolerance and OTP

Java Core | Modern Java Concurrency | Martijn Verburg & Ben Evans
Java Core | Modern Java Concurrency | Martijn Verburg & Ben EvansJava Core | Modern Java Concurrency | Martijn Verburg & Ben Evans
Java Core | Modern Java Concurrency | Martijn Verburg & Ben Evans
JAX London
 
Concurrent processing and distributed computing
Concurrent processing and distributed computingConcurrent processing and distributed computing
Concurrent processing and distributed computing
Rahul Ramteke
 

Similar to Actors, Fault tolerance and OTP (20)

BEAM in Action: Scrivere una web application con Elixir - Gabriele Santomaggi...
BEAM in Action: Scrivere una web application con Elixir - Gabriele Santomaggi...BEAM in Action: Scrivere una web application con Elixir - Gabriele Santomaggi...
BEAM in Action: Scrivere una web application con Elixir - Gabriele Santomaggi...
 
Un actor (model) per amico - Alessandro Melchiori - Codemotion Milan 2016
Un actor (model) per amico - Alessandro Melchiori - Codemotion Milan 2016Un actor (model) per amico - Alessandro Melchiori - Codemotion Milan 2016
Un actor (model) per amico - Alessandro Melchiori - Codemotion Milan 2016
 
Thread with care: concurrency pitfalls in Java [Iași CodeCamp 25th October 2014]
Thread with care: concurrency pitfalls in Java [Iași CodeCamp 25th October 2014]Thread with care: concurrency pitfalls in Java [Iași CodeCamp 25th October 2014]
Thread with care: concurrency pitfalls in Java [Iași CodeCamp 25th October 2014]
 
Luigi lauro thread with care (concurrency pitfalls in java)
Luigi lauro   thread with care (concurrency pitfalls in java)Luigi lauro   thread with care (concurrency pitfalls in java)
Luigi lauro thread with care (concurrency pitfalls in java)
 
Evolution of JDK Tools for Multithreaded Programming
Evolution of JDK Tools for Multithreaded ProgrammingEvolution of JDK Tools for Multithreaded Programming
Evolution of JDK Tools for Multithreaded Programming
 
Architecture of web servers
Architecture of web serversArchitecture of web servers
Architecture of web servers
 
PromptWorks Talk Tuesdays: Ray Zane 9/13/16 "Elixir Processes"
PromptWorks Talk Tuesdays: Ray Zane 9/13/16 "Elixir Processes"PromptWorks Talk Tuesdays: Ray Zane 9/13/16 "Elixir Processes"
PromptWorks Talk Tuesdays: Ray Zane 9/13/16 "Elixir Processes"
 
Multithreading 101
Multithreading 101Multithreading 101
Multithreading 101
 
J threads-pdf
J threads-pdfJ threads-pdf
J threads-pdf
 
卒研発表
卒研発表卒研発表
卒研発表
 
Networking threads
Networking threadsNetworking threads
Networking threads
 
Introduction to actor model with examples on Akka.NET
Introduction to actor model with examples on Akka.NETIntroduction to actor model with examples on Akka.NET
Introduction to actor model with examples on Akka.NET
 
Repeating History...On Purpose...with Elixir
Repeating History...On Purpose...with ElixirRepeating History...On Purpose...with Elixir
Repeating History...On Purpose...with Elixir
 
Java Core | Modern Java Concurrency | Martijn Verburg & Ben Evans
Java Core | Modern Java Concurrency | Martijn Verburg & Ben EvansJava Core | Modern Java Concurrency | Martijn Verburg & Ben Evans
Java Core | Modern Java Concurrency | Martijn Verburg & Ben Evans
 
Concurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple SpacesConcurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple Spaces
 
Concurrent processing and distributed computing
Concurrent processing and distributed computingConcurrent processing and distributed computing
Concurrent processing and distributed computing
 
Erlang, an overview
Erlang, an overviewErlang, an overview
Erlang, an overview
 
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...
 
Beyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor ProgrammingBeyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor Programming
 
Sharing-akka-pub
Sharing-akka-pubSharing-akka-pub
Sharing-akka-pub
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

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...
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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
 
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
 
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...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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)
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
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...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 

Actors, Fault tolerance and OTP

  • 1. Actor Oriented Programming, Fault Tolerance and OTP Dhananjay Nene #devcamp pune April 9 th , 2011
  • 2. What is the Actor Model ?
  • 3. “ In computer science, the Actor model is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent digital computation : in response to a message that it receives , an actor can make local decisions, create more actors, send more messages, and determine how to respond to the next message received.” – Wikipedia (Actor Model)
  • 5. In erlang parlance, each actor is a process
  • 6. However thats not the same as an operating system process. A single OS process hosts many erlang processes. An erlang process is far lighter than even a thread.
  • 7. Isolation : Processes are isolated. They do not share any memory between themselves. Garbage collection also works independently per processes
  • 8. Since processes run concurrently, the inability to share memory between them reduces many of the difficulties associated with conventional multi threaded programming
  • 9. Messages : Processes interact with each other by sending each other messages asynchronously
  • 10. For asynchronous messaging to work each process has a mailbox of messages and it processes one message at a time from the mailbox
  • 11. Introduction : Sleeping Barber Problem
  • 12. OTP : Open Telecom Platform
  • 13. OTP plays a somewhat similar role as JEE does for Java
  • 14.
  • 19. Philosophy : Let it crash
  • 20. Let it crash actually encouraging higher availability initially seems like an oxymoron
  • 21. But what it really emphasises is the ensured continued availability of the overall system rather than the robustness of every small piece that forms it.
  • 22. So what features of erlang help fault tolerance?
  • 23. Light weight process design allows modeling highly concurrent set of activities
  • 24. Shared Nothing / Process Isolation allows any process to fail without directly negatively impacting any other process
  • 25. Code demonstrated : Erlang : https://github.com/dnene/sleeping-barber/tree/34616b7c692b8b18eac71d34a7b30b65b2d94e20 Scala – akka https://github.com/dnene/sleeping-barber/tree/34616b7c692b8b18eac71d34a7b30b65b2d94e20
  • 26. Ability to link processes, and create supervisor and monitor hierarchy allows graceful resumption of failed services