SlideShare a Scribd company logo
An Introduction to
Akka and the Actor-Based Model
Daniela Sfregola
@DanielaSfregola
http://danielasfregola.com/
Scala Italy 2015
An Introduction to Akka and the Actor-Based Model 1/14
Outline
Motivation: Concurrency
Thread-Lock-Monitor Approach
Message-Passing Approach
Akka as Message-Passing Framework
Actors in Akka
Actor Life Cycle
Actors Hierarchy
Supervision Rules
Demo
An Introduction to Akka and the Actor-Based Model 2/14
Motivation: Concurrency
Low Cost Hardware
Multiple Core CPUs
Distributed Systems
Big Data
Parallelism
We need to deal with shared resources between processes!
An Introduction to Akka and the Actor-Based Model 3/14
Thread-Lock-Monitor Approach
Thread-Lock-Monitor approach can be challenging:
Logic complicated for humans
Difficult to design and maintain
High unpredictability
Do we have an easier approach to tackle concurrency problems?
An Introduction to Akka and the Actor-Based Model 4/14
Message-Passing Approach
The Message-Passing Approach:
Encapsulates all the shared information in messages
Messages are used to communicate between processes
An Introduction to Akka and the Actor-Based Model 5/14
Akka as Message-Passing Framework
Akka - from akka.io
Build powerful concurrent & distributed applications more easily.
Simple Concurrency & Distribution
Resilient by Design
High Performance
Elastic & Decentralized
Extensible
It supports Scala, Java... .NET is coming soon!
An Introduction to Akka and the Actor-Based Model 6/14
Actors in Akka
Lightweight concurrent entity
Event-driven
Mailbox of messages processed asynchronously
Can hold status/mutability
An Introduction to Akka and the Actor-Based Model 7/14
Actor Life Cycle
Akka in action (2013) by R. Roestenburg, R. Bakker and R. Williams.
Shelter Island: Manning Publication
An Introduction to Akka and the Actor-Based Model 8/14
Actors Hierarchy
from http://doc.akka.io/docs/akka/snapshot/general/supervision.html#supervision,
accessed on May 2015
An Introduction to Akka and the Actor-Based Model 9/14
Supervision Rules
Your Father is your Supervisor
Every Actor has a Supervisor, but the Guardian Actor (/user)
Your Children follow your destiny
If unable to handle an exception, escalate it to your Supervisor
If the Guardian Actor is unable to handle an exception, the system
will shutdown
An Introduction to Akka and the Actor-Based Model 10/14
Actor Core Operations
There are four core operations on Actors:
create
send
become
supervise
An Introduction to Akka and the Actor-Based Model 11/14
Demo
Demo Time!
Gist available at
https://gist.github.com/DanielaSfregola/
6dc52bffa2ed566de9b2
An Introduction to Akka and the Actor-Based Model 12/14
Conclusions
Akka as Message-Passing approach to concurrency
Main components: Actors
Best Practices:
Never Block
Communicate only via messages
Messages should be immutable
Messages should be complete and self-contained
An Introduction to Akka and the Actor-Based Model 13/14
Conclusions
Akka as Message-Passing approach to concurrency
Main components: Actors
Best Practices:
Never Block
Communicate only via messages
Messages should be immutable
Messages should be complete and self-contained
Thank you!
An Introduction to Akka and the Actor-Based Model 14/14

More Related Content

What's hot

Actor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder MeetupActor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder Meetup
Apcera
 
Introduction to the Actor Model
Introduction to the Actor ModelIntroduction to the Actor Model
Introduction to the Actor Model
BoldRadius Solutions
 
Relax, it's spa time
Relax, it's spa timeRelax, it's spa time
Relax, it's spa time
Monica Rodrigues
 
Solid principles
Solid principlesSolid principles
Solid principles
Monica Rodrigues
 
You Used To Inject Me In Your Constructor
 You Used To Inject Me In Your Constructor You Used To Inject Me In Your Constructor
You Used To Inject Me In Your Constructor
Veronica Lillie
 
Fundamentals of Akka - Webinar
Fundamentals of Akka - WebinarFundamentals of Akka - Webinar
Fundamentals of Akka - Webinar
Knoldus Inc.
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design Principles
Samuel Breed
 
Introduction to Functional Reactive Programming
Introduction to Functional Reactive ProgrammingIntroduction to Functional Reactive Programming
Introduction to Functional Reactive Programming
Đặng Thái Sơn
 
Discovering the Service Fabric's actor model
Discovering the Service Fabric's actor modelDiscovering the Service Fabric's actor model
Discovering the Service Fabric's actor model
Massimo Bonanni
 
Rethinking the debugger
Rethinking the debuggerRethinking the debugger
Rethinking the debugger
Iulian Dragos
 
Fp and scala
Fp and scalaFp and scala
Fp and scala
vikram kadi
 
Let it crash! The Erlang Approach to Building Reliable Services
Let it crash! The Erlang Approach to Building Reliable ServicesLet it crash! The Erlang Approach to Building Reliable Services
Let it crash! The Erlang Approach to Building Reliable Services
Brian Troutwine
 
SOLID Principles
SOLID PrinciplesSOLID Principles
SOLID Principles
Surendra Shukla
 
Beyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor ProgrammingBeyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor Programming
Fabio Tiriticco
 
Akka - young fighter course
Akka - young fighter courseAkka - young fighter course
Akka - young fighter course
Dmitriy Gutman
 
How does Scala's Future work?
How does Scala's Future work?How does Scala's Future work?
How does Scala's Future work?
Hanfei Sun
 
How netty works internally
How netty works internallyHow netty works internally
How netty works internally
AmirHossain94
 
Erlang workshopdrammen
Erlang workshopdrammenErlang workshopdrammen
Erlang workshopdrammen
Reidar Sollid
 
Actor Model & Reactive Manifesto
Actor Model & Reactive ManifestoActor Model & Reactive Manifesto
Actor Model & Reactive Manifesto
Angelo Simone Scotto
 

What's hot (19)

Actor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder MeetupActor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder Meetup
 
Introduction to the Actor Model
Introduction to the Actor ModelIntroduction to the Actor Model
Introduction to the Actor Model
 
Relax, it's spa time
Relax, it's spa timeRelax, it's spa time
Relax, it's spa time
 
Solid principles
Solid principlesSolid principles
Solid principles
 
You Used To Inject Me In Your Constructor
 You Used To Inject Me In Your Constructor You Used To Inject Me In Your Constructor
You Used To Inject Me In Your Constructor
 
Fundamentals of Akka - Webinar
Fundamentals of Akka - WebinarFundamentals of Akka - Webinar
Fundamentals of Akka - Webinar
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design Principles
 
Introduction to Functional Reactive Programming
Introduction to Functional Reactive ProgrammingIntroduction to Functional Reactive Programming
Introduction to Functional Reactive Programming
 
Discovering the Service Fabric's actor model
Discovering the Service Fabric's actor modelDiscovering the Service Fabric's actor model
Discovering the Service Fabric's actor model
 
Rethinking the debugger
Rethinking the debuggerRethinking the debugger
Rethinking the debugger
 
Fp and scala
Fp and scalaFp and scala
Fp and scala
 
Let it crash! The Erlang Approach to Building Reliable Services
Let it crash! The Erlang Approach to Building Reliable ServicesLet it crash! The Erlang Approach to Building Reliable Services
Let it crash! The Erlang Approach to Building Reliable Services
 
SOLID Principles
SOLID PrinciplesSOLID Principles
SOLID Principles
 
Beyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor ProgrammingBeyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor Programming
 
Akka - young fighter course
Akka - young fighter courseAkka - young fighter course
Akka - young fighter course
 
How does Scala's Future work?
How does Scala's Future work?How does Scala's Future work?
How does Scala's Future work?
 
How netty works internally
How netty works internallyHow netty works internally
How netty works internally
 
Erlang workshopdrammen
Erlang workshopdrammenErlang workshopdrammen
Erlang workshopdrammen
 
Actor Model & Reactive Manifesto
Actor Model & Reactive ManifestoActor Model & Reactive Manifesto
Actor Model & Reactive Manifesto
 

Similar to Scala Italy 2015 - An Introduction to Akka and the Actor Based Model

Daniela Sfregola - Intro to Akka
Daniela Sfregola - Intro to AkkaDaniela Sfregola - Intro to Akka
Daniela Sfregola - Intro to Akka
Scala Italy
 
Actor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder MeetupActor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder Meetup
NATS
 
IEEE Day 2013 Baku - Spring Framework overview and Spring MVC
IEEE Day 2013 Baku - Spring Framework overview and Spring MVCIEEE Day 2013 Baku - Spring Framework overview and Spring MVC
IEEE Day 2013 Baku - Spring Framework overview and Spring MVC
Ilkin Ashrafli
 
Introduction to Actor Model and Akka
Introduction to Actor Model and AkkaIntroduction to Actor Model and Akka
Introduction to Actor Model and Akka
Yung-Lin Ho
 
Evolve18 | Abhishek Dwevidi & Varun Mitra | Intro to Backend Development in AEM
Evolve18 | Abhishek Dwevidi & Varun Mitra | Intro to Backend Development in AEMEvolve18 | Abhishek Dwevidi & Varun Mitra | Intro to Backend Development in AEM
Evolve18 | Abhishek Dwevidi & Varun Mitra | Intro to Backend Development in AEM
Evolve The Adobe Digital Marketing Community
 
Actor-based concurrency in a modern Java Enterprise
Actor-based concurrency in a modern Java EnterpriseActor-based concurrency in a modern Java Enterprise
Actor-based concurrency in a modern Java Enterprise
Alexander Lukyanchikov
 
Spring Boot Microservices vs Akka Actor Cluster
Spring Boot Microservices vs Akka Actor Cluster Spring Boot Microservices vs Akka Actor Cluster
Spring Boot Microservices vs Akka Actor Cluster
OpenCredo
 
Reactive programming with akka
Reactive programming with akkaReactive programming with akka
Reactive programming with akka
Webdesign Factory
 
Using Scrum on 3SL Cradle - traceability model and project schema
Using Scrum on 3SL Cradle - traceability model and project schemaUsing Scrum on 3SL Cradle - traceability model and project schema
Using Scrum on 3SL Cradle - traceability model and project schema
Yulia Madorskaya
 
When Camel Smiles
When Camel SmilesWhen Camel Smiles
When Camel Smiles
Orest Ivasiv
 
Scala introduction
Scala introductionScala introduction
Scala introduction
zvikapika
 
Trivadis TechEvent 2016 Introduction to Lagom - another microservice-based fr...
Trivadis TechEvent 2016 Introduction to Lagom - another microservice-based fr...Trivadis TechEvent 2016 Introduction to Lagom - another microservice-based fr...
Trivadis TechEvent 2016 Introduction to Lagom - another microservice-based fr...
Trivadis
 
Akka-intro-training-public.pdf
Akka-intro-training-public.pdfAkka-intro-training-public.pdf
Akka-intro-training-public.pdf
BernardDeffarges
 
Display earthquakes with Akka-http
Display earthquakes with Akka-httpDisplay earthquakes with Akka-http
Display earthquakes with Akka-http
Pierangelo Cecchetto
 
Build Cloud Applications with Akka and Heroku
Build Cloud Applications with Akka and HerokuBuild Cloud Applications with Akka and Heroku
Build Cloud Applications with Akka and Heroku
Salesforce Developers
 
Akka for big data developers
Akka for big data developersAkka for big data developers
Akka for big data developers
Taras Fedorov
 
Reactive Streams - László van den Hoek
Reactive Streams - László van den HoekReactive Streams - László van den Hoek
Reactive Streams - László van den Hoek
RubiX BV
 
Streams of RDF Events Derive2015
Streams of RDF Events Derive2015Streams of RDF Events Derive2015
Streams of RDF Events Derive2015
Jean-Paul Calbimonte
 
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 ...
Codemotion
 
Spring Framework Tutorial for Beginners.pdf
Spring Framework Tutorial for Beginners.pdfSpring Framework Tutorial for Beginners.pdf
Spring Framework Tutorial for Beginners.pdf
SudhanshiBakre1
 

Similar to Scala Italy 2015 - An Introduction to Akka and the Actor Based Model (20)

Daniela Sfregola - Intro to Akka
Daniela Sfregola - Intro to AkkaDaniela Sfregola - Intro to Akka
Daniela Sfregola - Intro to Akka
 
Actor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder MeetupActor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder Meetup
 
IEEE Day 2013 Baku - Spring Framework overview and Spring MVC
IEEE Day 2013 Baku - Spring Framework overview and Spring MVCIEEE Day 2013 Baku - Spring Framework overview and Spring MVC
IEEE Day 2013 Baku - Spring Framework overview and Spring MVC
 
Introduction to Actor Model and Akka
Introduction to Actor Model and AkkaIntroduction to Actor Model and Akka
Introduction to Actor Model and Akka
 
Evolve18 | Abhishek Dwevidi & Varun Mitra | Intro to Backend Development in AEM
Evolve18 | Abhishek Dwevidi & Varun Mitra | Intro to Backend Development in AEMEvolve18 | Abhishek Dwevidi & Varun Mitra | Intro to Backend Development in AEM
Evolve18 | Abhishek Dwevidi & Varun Mitra | Intro to Backend Development in AEM
 
Actor-based concurrency in a modern Java Enterprise
Actor-based concurrency in a modern Java EnterpriseActor-based concurrency in a modern Java Enterprise
Actor-based concurrency in a modern Java Enterprise
 
Spring Boot Microservices vs Akka Actor Cluster
Spring Boot Microservices vs Akka Actor Cluster Spring Boot Microservices vs Akka Actor Cluster
Spring Boot Microservices vs Akka Actor Cluster
 
Reactive programming with akka
Reactive programming with akkaReactive programming with akka
Reactive programming with akka
 
Using Scrum on 3SL Cradle - traceability model and project schema
Using Scrum on 3SL Cradle - traceability model and project schemaUsing Scrum on 3SL Cradle - traceability model and project schema
Using Scrum on 3SL Cradle - traceability model and project schema
 
When Camel Smiles
When Camel SmilesWhen Camel Smiles
When Camel Smiles
 
Scala introduction
Scala introductionScala introduction
Scala introduction
 
Trivadis TechEvent 2016 Introduction to Lagom - another microservice-based fr...
Trivadis TechEvent 2016 Introduction to Lagom - another microservice-based fr...Trivadis TechEvent 2016 Introduction to Lagom - another microservice-based fr...
Trivadis TechEvent 2016 Introduction to Lagom - another microservice-based fr...
 
Akka-intro-training-public.pdf
Akka-intro-training-public.pdfAkka-intro-training-public.pdf
Akka-intro-training-public.pdf
 
Display earthquakes with Akka-http
Display earthquakes with Akka-httpDisplay earthquakes with Akka-http
Display earthquakes with Akka-http
 
Build Cloud Applications with Akka and Heroku
Build Cloud Applications with Akka and HerokuBuild Cloud Applications with Akka and Heroku
Build Cloud Applications with Akka and Heroku
 
Akka for big data developers
Akka for big data developersAkka for big data developers
Akka for big data developers
 
Reactive Streams - László van den Hoek
Reactive Streams - László van den HoekReactive Streams - László van den Hoek
Reactive Streams - László van den Hoek
 
Streams of RDF Events Derive2015
Streams of RDF Events Derive2015Streams of RDF Events Derive2015
Streams of RDF Events Derive2015
 
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 ...
 
Spring Framework Tutorial for Beginners.pdf
Spring Framework Tutorial for Beginners.pdfSpring Framework Tutorial for Beginners.pdf
Spring Framework Tutorial for Beginners.pdf
 

Recently uploaded

GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
pavan998932
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
kalichargn70th171
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Envertis Software Solutions
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 

Recently uploaded (20)

GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 

Scala Italy 2015 - An Introduction to Akka and the Actor Based Model

  • 1. An Introduction to Akka and the Actor-Based Model Daniela Sfregola @DanielaSfregola http://danielasfregola.com/ Scala Italy 2015 An Introduction to Akka and the Actor-Based Model 1/14
  • 2. Outline Motivation: Concurrency Thread-Lock-Monitor Approach Message-Passing Approach Akka as Message-Passing Framework Actors in Akka Actor Life Cycle Actors Hierarchy Supervision Rules Demo An Introduction to Akka and the Actor-Based Model 2/14
  • 3. Motivation: Concurrency Low Cost Hardware Multiple Core CPUs Distributed Systems Big Data Parallelism We need to deal with shared resources between processes! An Introduction to Akka and the Actor-Based Model 3/14
  • 4. Thread-Lock-Monitor Approach Thread-Lock-Monitor approach can be challenging: Logic complicated for humans Difficult to design and maintain High unpredictability Do we have an easier approach to tackle concurrency problems? An Introduction to Akka and the Actor-Based Model 4/14
  • 5. Message-Passing Approach The Message-Passing Approach: Encapsulates all the shared information in messages Messages are used to communicate between processes An Introduction to Akka and the Actor-Based Model 5/14
  • 6. Akka as Message-Passing Framework Akka - from akka.io Build powerful concurrent & distributed applications more easily. Simple Concurrency & Distribution Resilient by Design High Performance Elastic & Decentralized Extensible It supports Scala, Java... .NET is coming soon! An Introduction to Akka and the Actor-Based Model 6/14
  • 7. Actors in Akka Lightweight concurrent entity Event-driven Mailbox of messages processed asynchronously Can hold status/mutability An Introduction to Akka and the Actor-Based Model 7/14
  • 8. Actor Life Cycle Akka in action (2013) by R. Roestenburg, R. Bakker and R. Williams. Shelter Island: Manning Publication An Introduction to Akka and the Actor-Based Model 8/14
  • 10. Supervision Rules Your Father is your Supervisor Every Actor has a Supervisor, but the Guardian Actor (/user) Your Children follow your destiny If unable to handle an exception, escalate it to your Supervisor If the Guardian Actor is unable to handle an exception, the system will shutdown An Introduction to Akka and the Actor-Based Model 10/14
  • 11. Actor Core Operations There are four core operations on Actors: create send become supervise An Introduction to Akka and the Actor-Based Model 11/14
  • 12. Demo Demo Time! Gist available at https://gist.github.com/DanielaSfregola/ 6dc52bffa2ed566de9b2 An Introduction to Akka and the Actor-Based Model 12/14
  • 13. Conclusions Akka as Message-Passing approach to concurrency Main components: Actors Best Practices: Never Block Communicate only via messages Messages should be immutable Messages should be complete and self-contained An Introduction to Akka and the Actor-Based Model 13/14
  • 14. Conclusions Akka as Message-Passing approach to concurrency Main components: Actors Best Practices: Never Block Communicate only via messages Messages should be immutable Messages should be complete and self-contained Thank you! An Introduction to Akka and the Actor-Based Model 14/14