SlideShare a Scribd company logo
Akka Fundamentals
Agenda
• Why Akka?
• Actor Model
• Actor API (Scala/Java)
• Fault Tolerance - Supervision
• Routing
Akka Fundamentals
Shared-State
Concurrency
Akka Fundamentals
Akka Fundamentals
Akka Fundamentals
Users:
- John Snow
- Bran Stark
- Tyrion Lannister
Akka Fundamentals
Locks
Akka Fundamentals
• Error Prone
• Hard to reason about
• Hard to implement
• Hard to debug
• Ugly
• Low level
• …
"All problems in computer
science can be solved by
another level of indirection"
David Wheeler
The Actor Model
A selection of events in the history of Actors:
• Carl Hewitt et al, 1973: Actors invented for research on AI
• Gul Agha, 1986: Actor languages and communication patterns
• Ericsson, 1995: first commercial use in Erlang/OTP for telecom
platform
• Phillip Haller, 2006: implemented in the Scala stdlib
• Jonas Boner, 2009: creation of Akka
Principles of Reactive Programming, Week 5 Part 1
An Actor
Akka Fundamentals
What’s the time?
13:30
What’s the time?
What’s the time?
13:30
Message Passing
An Actor:
• Encapsulates state
• Has a behaviour (logic)
• Communicates via async messages
The Actor API
Akka Fundamentals
Akka Fundamentals
Akka Fundamentals
State
Behaviour
Messages
Akka Fundamentals
Akka Fundamentals
Akka Fundamentals
Akka Fundamentals
Akka Fundamentals
State
Behaviour
Messages
Fault Tolerance
Akka Fundamentals
Akka Fundamentals
Akka Fundamentals
Akka Fundamentals
Akka Fundamentals
Akka Fundamentals
We’ve crossed thread boundaries
This async boundary is explicit and a first class citizen in Akka
• All Actor communication is message based
• Errors are messages
Akka guides you in building fault tolerant applications by
embracing failure.
“Let it crash”
Akka’s fault tolerance policy:
• supervised Actors form a tree structure
• the supervisor needs to create its child
• failed Actor is terminated or restarted
• decision must be taken by one other Actor
Supervision
Boss
Worker A Worker B Worker C
Actors form hierarchies
Worker A Worker B Worker C
Boss
SupervisorStrategy
• OneForOneStrategy
• AllForOneStrategy
Decider
Akka Fundamentals
Boss
Worker A Worker B Worker C
Boss
Worker A Worker B Worker C
Boss
Worker A Worker B Worker C
Boss
Worker A Worker B Worker C
Boss
Worker A Worker B Worker C
Boss + Workers
System
Boss + Workers
System
Boss + Workers
System
Error Kernel Pattern
Routing
An abstraction over the delivery of messages from a
Sender to Receiver(s)
Akka Fundamentals
Router
• Akka provides several builtin Routers
• You may of course define your own
Round Robin Router
D. Wyatt - Akka Concurrency
Broadcast Router
D. Wyatt - Akka Concurrency
Smallest Mailbox Router
D. Wyatt - Akka Concurrency
Two types of routers:
1. Pool
• Router creates routees
2. Group
• You create routees and pass them in
Pool
application.conf
By Configuration
MyActor.scala
Programatically
Group
By Configuration
application.conf
MyActor.scala
Programatically
Akka Fundamentals
Akka Fundamentals

More Related Content

PDF
A gentle introduction into AKKA and the actor model
Mykhailo Kotsur
 
KEY
Introduction to Actor Model and Akka
Yung-Lin Ho
 
PPTX
Akka framework
mitesh_sharma
 
PDF
Actor model : A Different Concurrency Approach
Emre Akış
 
PDF
Actor model in .NET - Akka.NET
Konrad Dusza
 
PDF
Introducing Akka
Jonas Bonér
 
PPTX
Introduction to Akka - Atlanta Java Users Group
Roy Russo
 
PDF
Introduction to Akka
Knoldus Inc.
 
A gentle introduction into AKKA and the actor model
Mykhailo Kotsur
 
Introduction to Actor Model and Akka
Yung-Lin Ho
 
Akka framework
mitesh_sharma
 
Actor model : A Different Concurrency Approach
Emre Akış
 
Actor model in .NET - Akka.NET
Konrad Dusza
 
Introducing Akka
Jonas Bonér
 
Introduction to Akka - Atlanta Java Users Group
Roy Russo
 
Introduction to Akka
Knoldus Inc.
 

What's hot (20)

PPTX
Developing distributed applications with Akka and Akka Cluster
Konstantin Tsykulenko
 
PPTX
The Actor Model - Towards Better Concurrency
Dror Bereznitsky
 
KEY
Actors and Threads
mperham
 
PPTX
CQRS + ES with Scala and Akka
Bharadwaj N
 
PPTX
Akka.net versus microsoft orleans
Bill Tulloch
 
ODP
Reactive programming with scala and akka
Knoldus Inc.
 
PDF
Actor Patterns and NATS - Boulder Meetup
Apcera
 
PPTX
Akka.Net Overview
Geoffrey Vandiest
 
PPTX
Project Orleans - Actor Model framework
Neil Mackenzie
 
PPTX
Akkurate Akka
Yurii Ostapchuk
 
PPTX
Akka Actors
Dylan Forciea
 
PPTX
Actors Set the Stage for Project Orleans
cjmyers
 
PPTX
"Walk in a distributed systems park with Orleans" Евгений Бобров
Fwdays
 
PDF
Rethinking the debugger
Iulian Dragos
 
PDF
Learn Elixir at Manchester Lambda Lounge
Chi-chi Ekweozor
 
PDF
Model with actors and implement with Akka
Ngoc Dao
 
PDF
Introduction to the Actor Model
BoldRadius Solutions
 
PPTX
A Brief Intro to Microsoft Orleans
Uri Goldstein
 
PDF
Full-Stack, Message-oriented Programming w/ Akka.NET Actors
petabridge
 
PDF
Erlang as a cloud citizen, a fractal approach to throughput
Paolo Negri
 
Developing distributed applications with Akka and Akka Cluster
Konstantin Tsykulenko
 
The Actor Model - Towards Better Concurrency
Dror Bereznitsky
 
Actors and Threads
mperham
 
CQRS + ES with Scala and Akka
Bharadwaj N
 
Akka.net versus microsoft orleans
Bill Tulloch
 
Reactive programming with scala and akka
Knoldus Inc.
 
Actor Patterns and NATS - Boulder Meetup
Apcera
 
Akka.Net Overview
Geoffrey Vandiest
 
Project Orleans - Actor Model framework
Neil Mackenzie
 
Akkurate Akka
Yurii Ostapchuk
 
Akka Actors
Dylan Forciea
 
Actors Set the Stage for Project Orleans
cjmyers
 
"Walk in a distributed systems park with Orleans" Евгений Бобров
Fwdays
 
Rethinking the debugger
Iulian Dragos
 
Learn Elixir at Manchester Lambda Lounge
Chi-chi Ekweozor
 
Model with actors and implement with Akka
Ngoc Dao
 
Introduction to the Actor Model
BoldRadius Solutions
 
A Brief Intro to Microsoft Orleans
Uri Goldstein
 
Full-Stack, Message-oriented Programming w/ Akka.NET Actors
petabridge
 
Erlang as a cloud citizen, a fractal approach to throughput
Paolo Negri
 
Ad

Viewers also liked (20)

PPTX
Akka Actor presentation
Gene Chang
 
PDF
Building Reactive Systems with Akka (in Java 8 or Scala)
Jonas Bonér
 
PDF
Introduction to Akka
Johan Andrén
 
PDF
Akka in 100 slides or less
Derek Wyatt
 
PDF
Event-sourced architectures with Akka
Sander Mak (@Sander_Mak)
 
PPTX
Intro to Akka Streams
Michael Kendra
 
PPTX
Concurrency, Scalability & Fault-tolerance 2.0 with Akka Actors & STM
Mario Fusco
 
PDF
Effective Scala (JavaDay Riga 2013)
mircodotta
 
PPTX
Functional Programming and Concurrency Patterns in Scala
kellogh
 
PDF
Effective Scala: Programming Patterns
Vasil Remeniuk
 
PPTX
Scala’s implicits
Pablo Francisco Pérez Hidalgo
 
PDF
Real-World Scala Design Patterns
NLJUG
 
PPTX
Akka: Введение
Iosif Itkin
 
PDF
Scala Implicits - Not to be feared
Derek Wyatt
 
PDF
Streaming data to s3 using akka streams
Mikhail Girkin
 
PDF
Online game server on Akka.NET (NDC2016)
Esun Kim
 
ODP
Scal`a`ngular - Scala and Angular
Knoldus Inc.
 
PDF
Effective Scala (SoftShake 2013)
mircodotta
 
PPTX
Akkaships: "Primeros pasos con Akka: Olvídate de los threads"
Miguel Angel Fernandez Diaz
 
PDF
Akka Streams in Action @ ScalaDays Berlin 2016
Konrad Malawski
 
Akka Actor presentation
Gene Chang
 
Building Reactive Systems with Akka (in Java 8 or Scala)
Jonas Bonér
 
Introduction to Akka
Johan Andrén
 
Akka in 100 slides or less
Derek Wyatt
 
Event-sourced architectures with Akka
Sander Mak (@Sander_Mak)
 
Intro to Akka Streams
Michael Kendra
 
Concurrency, Scalability & Fault-tolerance 2.0 with Akka Actors & STM
Mario Fusco
 
Effective Scala (JavaDay Riga 2013)
mircodotta
 
Functional Programming and Concurrency Patterns in Scala
kellogh
 
Effective Scala: Programming Patterns
Vasil Remeniuk
 
Scala’s implicits
Pablo Francisco Pérez Hidalgo
 
Real-World Scala Design Patterns
NLJUG
 
Akka: Введение
Iosif Itkin
 
Scala Implicits - Not to be feared
Derek Wyatt
 
Streaming data to s3 using akka streams
Mikhail Girkin
 
Online game server on Akka.NET (NDC2016)
Esun Kim
 
Scal`a`ngular - Scala and Angular
Knoldus Inc.
 
Effective Scala (SoftShake 2013)
mircodotta
 
Akkaships: "Primeros pasos con Akka: Olvídate de los threads"
Miguel Angel Fernandez Diaz
 
Akka Streams in Action @ ScalaDays Berlin 2016
Konrad Malawski
 
Ad

Similar to Akka Fundamentals (20)

PPTX
Real world Scala hAkking NLJUG JFall 2011
Raymond Roestenburg
 
PPTX
Reactive Streams - László van den Hoek
RubiX BV
 
PDF
Akka in Action: Heiko Seeburger
JAX London
 
PDF
Actors evolved- Rotem Hermon
distributed matters
 
PPTX
DotNext 2020 - When and How to Use the Actor Model and Akka.NET
petabridge
 
PDF
Building Reactive applications with Akka
Knoldus Inc.
 
PDF
Akka in Production - ScalaDays 2015
Evan Chan
 
PDF
Agile Lab_BigData_Meetup_AKKA
Paolo Platter
 
PPTX
Reactive Programming using Actor Model in Akka
StephenKoc1
 
PDF
Build Cloud Applications with Akka and Heroku
Salesforce Developers
 
PPTX
Multi-threading in the modern era: Vertx Akka and Quasar
Gal Marder
 
PPTX
Fundamentals of Akka - Webinar
Knoldus Inc.
 
PDF
Akka A to Z: A Guide To The Industry’s Best Toolkit for Fast Data and Microse...
Lightbend
 
PDF
Introducingakkajavazone2012 120914094033-phpapp02
Typesafe
 
PPTX
Composable Futures with Akka 2.0
Mike Slinn
 
PDF
Reactive Web-Applications @ LambdaDays
Manuel Bernhardt
 
PDF
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...
Flink Forward
 
PPTX
Developing distributed applications with Akka and Akka Cluster
Konstantin Tsykulenko
 
PPTX
Spark Kernel Talk - Apache Spark Meetup San Francisco (July 2015)
Robert "Chip" Senkbeil
 
PDF
VoltDB and Erlang - Tech planet 2012
Eonblast
 
Real world Scala hAkking NLJUG JFall 2011
Raymond Roestenburg
 
Reactive Streams - László van den Hoek
RubiX BV
 
Akka in Action: Heiko Seeburger
JAX London
 
Actors evolved- Rotem Hermon
distributed matters
 
DotNext 2020 - When and How to Use the Actor Model and Akka.NET
petabridge
 
Building Reactive applications with Akka
Knoldus Inc.
 
Akka in Production - ScalaDays 2015
Evan Chan
 
Agile Lab_BigData_Meetup_AKKA
Paolo Platter
 
Reactive Programming using Actor Model in Akka
StephenKoc1
 
Build Cloud Applications with Akka and Heroku
Salesforce Developers
 
Multi-threading in the modern era: Vertx Akka and Quasar
Gal Marder
 
Fundamentals of Akka - Webinar
Knoldus Inc.
 
Akka A to Z: A Guide To The Industry’s Best Toolkit for Fast Data and Microse...
Lightbend
 
Introducingakkajavazone2012 120914094033-phpapp02
Typesafe
 
Composable Futures with Akka 2.0
Mike Slinn
 
Reactive Web-Applications @ LambdaDays
Manuel Bernhardt
 
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...
Flink Forward
 
Developing distributed applications with Akka and Akka Cluster
Konstantin Tsykulenko
 
Spark Kernel Talk - Apache Spark Meetup San Francisco (July 2015)
Robert "Chip" Senkbeil
 
VoltDB and Erlang - Tech planet 2012
Eonblast
 

Recently uploaded (20)

PDF
Cryptography and Information :Security Fundamentals
Dr. Madhuri Jawale
 
PPTX
Online Cab Booking and Management System.pptx
diptipaneri80
 
PDF
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
PDF
STUDY OF NOVEL CHANNEL MATERIALS USING III-V COMPOUNDS WITH VARIOUS GATE DIEL...
ijoejnl
 
PPTX
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
PDF
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 
PDF
Machine Learning All topics Covers In This Single Slides
AmritTiwari19
 
PDF
All chapters of Strength of materials.ppt
girmabiniyam1234
 
PPTX
Information Retrieval and Extraction - Module 7
premSankar19
 
PDF
Natural_Language_processing_Unit_I_notes.pdf
sanguleumeshit
 
PDF
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
PPTX
business incubation centre aaaaaaaaaaaaaa
hodeeesite4
 
PDF
CAD-CAM U-1 Combined Notes_57761226_2025_04_22_14_40.pdf
shailendrapratap2002
 
PPTX
MULTI LEVEL DATA TRACKING USING COOJA.pptx
dollysharma12ab
 
PPTX
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
PPTX
Tunnel Ventilation System in Kanpur Metro
220105053
 
PPTX
22PCOAM21 Session 1 Data Management.pptx
Guru Nanak Technical Institutions
 
PPTX
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
PDF
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
PDF
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
Cryptography and Information :Security Fundamentals
Dr. Madhuri Jawale
 
Online Cab Booking and Management System.pptx
diptipaneri80
 
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
STUDY OF NOVEL CHANNEL MATERIALS USING III-V COMPOUNDS WITH VARIOUS GATE DIEL...
ijoejnl
 
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 
Machine Learning All topics Covers In This Single Slides
AmritTiwari19
 
All chapters of Strength of materials.ppt
girmabiniyam1234
 
Information Retrieval and Extraction - Module 7
premSankar19
 
Natural_Language_processing_Unit_I_notes.pdf
sanguleumeshit
 
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
business incubation centre aaaaaaaaaaaaaa
hodeeesite4
 
CAD-CAM U-1 Combined Notes_57761226_2025_04_22_14_40.pdf
shailendrapratap2002
 
MULTI LEVEL DATA TRACKING USING COOJA.pptx
dollysharma12ab
 
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
Tunnel Ventilation System in Kanpur Metro
220105053
 
22PCOAM21 Session 1 Data Management.pptx
Guru Nanak Technical Institutions
 
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 

Akka Fundamentals

Editor's Notes

  • #4: “Free lunch is over” - 2005 Write program ’80 => come back later it’s faster Write program ’05 => come back later it’s the same Need to use multiple cores
  • #6: Simpler to show with Java
  • #10: Between these two instructions there’s a shitload of CPU cycles
  • #14: Let someone else go through the pain, once We benefit from the abstraction
  • #17: An actor by himself can’t do much
  • #33: Meaning gets lost in syntax
  • #59: Delegate dangerous work do the bottom Keep important state as high as possible
  • #61: Does not add any expressive power We can do this ourselves Just easier to use a provided thing
  • #62: We have to define and manipulate these arrows manually, overselves. Let’s try do it a better way
  • #63: Router is not an Actor
  • #66: If every actor is interested in a message If you don’t know whose interested in a message Notifier
  • #67: Load balancing
  • #69: router creates all children hence is their parent and supervisor
  • #70: Send messages to router, router forwards to routees Router does not change original sender
  • #74: Router uses ActorSelection to get ActorRefs Must create them ourselves
  • #75: Here we can set up any structure we wish