SlideShare ist ein Scribd-Unternehmen logo
1 von 43
AKKurate
twist522@gmail.com
JUG Lviv
outline
Problems to solve
Actor Model
Java & Scala actors
Fault-tolerance
Scaling, Remoting
Reactiveness
Some best practices
The Problem
• highly concurrent
• scalable
• fault-tolerant
AKKA
Program at a higher level
Scaling up & out
& down & .. whatever
Automatic Replication & Distribution
for fault tolerance & scalability
Automatic Load Balancing
Modules
• akka-kernel
• akka-actor
• akka-camel
• akka-remote
• akka-cluster
• akka-persistence
• akka-stream
• …
Actor Model
Back into the 70’s
actors could
• perform
• create another actors
• send messages
• become
Carl Hewitt
Actor
• one msg at a time
• in one thread
• msgs in order
• small (~2.5M per Gb)
Core operations
0. Define
1. Create
2. Send
3. Become
4. Supervise
0. Define
In Scala
1. Create
Actor hierarchy
2. Send
Full example
In Scala
Hot Swap
In Scala
ask
Futures
Supervision & Monitoring
• failures happen
• application should self-heal
• each actor have supervisor
• supervisor handles failures
– RESUME
– RESTART
– STOP
– ESCALATE
Failure management
money
snack
not enough!FATAL ERROR
FATAL ERROR
supervisor
Supervisor hierarchies
• One-for-one strategy
• All-for-one strategy
Root actors
4. Supervise
Death Watch
Failure management in Java
Load Balancing
• scaling up – routers
• scaling out – akka-cluster
Routers
From config
Routers
• Random
• Round-robin
• Smallest messagebox
• Broadcast
• ScatterGatherFirstCompletedOf
• …
Remote Deployment
Lookup
Note on reactiveness
Reactive manifesto
Actors should do only one thing
• Single responsibility principle
• Create specific supervisors
• Keep the error kernel simple
Avoid blocking
Don’t expose actors
• Avoid using this
• Don’t close over variables
• Use immutable messages with immutable
data
E0
F

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Indic threads pune12-akka-actors
Indic threads pune12-akka-actorsIndic threads pune12-akka-actors
Indic threads pune12-akka-actors
 
Sbt, idea and eclipse
Sbt, idea and eclipseSbt, idea and eclipse
Sbt, idea and eclipse
 
Evolving IGN’s New APIs with Scala
 Evolving IGN’s New APIs with Scala Evolving IGN’s New APIs with Scala
Evolving IGN’s New APIs with Scala
 
Azkaban and Pig at LinkedIn
Azkaban and Pig at LinkedInAzkaban and Pig at LinkedIn
Azkaban and Pig at LinkedIn
 
Is Serverless The New Swiss Cheese?
Is Serverless The New Swiss Cheese?Is Serverless The New Swiss Cheese?
Is Serverless The New Swiss Cheese?
 
AWS Serverless solution for developers
AWS Serverless solution for developersAWS Serverless solution for developers
AWS Serverless solution for developers
 
Spark UDFs are EviL, Catalyst to the rEsCue!
Spark UDFs are EviL, Catalyst to the rEsCue!Spark UDFs are EviL, Catalyst to the rEsCue!
Spark UDFs are EviL, Catalyst to the rEsCue!
 
Serverless Application Model - Executing Lambdas Locally
Serverless Application Model - Executing Lambdas LocallyServerless Application Model - Executing Lambdas Locally
Serverless Application Model - Executing Lambdas Locally
 
Scala for java developers 6 may 2017 - yeni
Scala for java developers   6 may 2017 - yeniScala for java developers   6 may 2017 - yeni
Scala for java developers 6 may 2017 - yeni
 
Inside Wordnik's Architecture
Inside Wordnik's ArchitectureInside Wordnik's Architecture
Inside Wordnik's Architecture
 
Armada - the way to ship microservices
Armada - the way to ship microservicesArmada - the way to ship microservices
Armada - the way to ship microservices
 
Akka and AngularJS – Reactive Applications in Practice
Akka and AngularJS – Reactive Applications in PracticeAkka and AngularJS – Reactive Applications in Practice
Akka and AngularJS – Reactive Applications in Practice
 
Serverless Architecture Patterns - Manoj Ganapathi
Serverless Architecture Patterns - Manoj GanapathiServerless Architecture Patterns - Manoj Ganapathi
Serverless Architecture Patterns - Manoj Ganapathi
 
Donald Ferguson - Old Programmers Can Learn New Tricks
Donald Ferguson - Old Programmers Can Learn New TricksDonald Ferguson - Old Programmers Can Learn New Tricks
Donald Ferguson - Old Programmers Can Learn New Tricks
 
Microservices Manchester: Lightning Talk- Actor Based Concurrency by Amy O'Leary
Microservices Manchester: Lightning Talk- Actor Based Concurrency by Amy O'LearyMicroservices Manchester: Lightning Talk- Actor Based Concurrency by Amy O'Leary
Microservices Manchester: Lightning Talk- Actor Based Concurrency by Amy O'Leary
 
Actors evolved- Rotem Hermon
Actors evolved- Rotem HermonActors evolved- Rotem Hermon
Actors evolved- Rotem Hermon
 
Riga Dev Days: Building a Smart Security Camera with Raspberry Pi Zero, Node....
Riga Dev Days: Building a Smart Security Camera with Raspberry Pi Zero, Node....Riga Dev Days: Building a Smart Security Camera with Raspberry Pi Zero, Node....
Riga Dev Days: Building a Smart Security Camera with Raspberry Pi Zero, Node....
 
Azkaban
AzkabanAzkaban
Azkaban
 
Clojure/north 2019 Raising Services and People with Clojure
Clojure/north 2019 Raising Services and People with ClojureClojure/north 2019 Raising Services and People with Clojure
Clojure/north 2019 Raising Services and People with Clojure
 
Developing distributed applications with Akka and Akka Cluster
Developing distributed applications with Akka and Akka ClusterDeveloping distributed applications with Akka and Akka Cluster
Developing distributed applications with Akka and Akka Cluster
 

Ähnlich wie Akkurate Akka

Polyglot Plugin Programming
Polyglot Plugin ProgrammingPolyglot Plugin Programming
Polyglot Plugin Programming
Atlassian
 

Ähnlich wie Akkurate Akka (20)

Indic threads pune12-typesafe stack software development on the jvm
Indic threads pune12-typesafe stack software development on the jvmIndic threads pune12-typesafe stack software development on the jvm
Indic threads pune12-typesafe stack software development on the jvm
 
From java to scala at crowd mix
From java to scala at crowd mixFrom java to scala at crowd mix
From java to scala at crowd mix
 
Scala in the Wild
Scala in the WildScala in the Wild
Scala in the Wild
 
Eclipse IDE for Scala (2.9 story)
Eclipse IDE for Scala (2.9 story)Eclipse IDE for Scala (2.9 story)
Eclipse IDE for Scala (2.9 story)
 
Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)
 
Polyglot Plugin Programming
Polyglot Plugin ProgrammingPolyglot Plugin Programming
Polyglot Plugin Programming
 
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
 
Scala Frustrations
Scala FrustrationsScala Frustrations
Scala Frustrations
 
Using Apache Camel as AKKA
Using Apache Camel as AKKAUsing Apache Camel as AKKA
Using Apache Camel as AKKA
 
Rethinking the debugger
Rethinking the debuggerRethinking the debugger
Rethinking the debugger
 
Scala Days Chicago 2017: Building a Company on Scala
Scala Days Chicago 2017: Building a Company on ScalaScala Days Chicago 2017: Building a Company on Scala
Scala Days Chicago 2017: Building a Company on Scala
 
Scala in practice
Scala in practiceScala in practice
Scala in practice
 
OpenWhisk Go Runtime
OpenWhisk Go RuntimeOpenWhisk Go Runtime
OpenWhisk Go Runtime
 
Take a Look at Akka+Java (English version)
Take a Look at Akka+Java (English version)Take a Look at Akka+Java (English version)
Take a Look at Akka+Java (English version)
 
Scala goods bads
Scala goods badsScala goods bads
Scala goods bads
 
Fundamentals of Akka - Webinar
Fundamentals of Akka - WebinarFundamentals of Akka - Webinar
Fundamentals of Akka - Webinar
 
Java Closures
Java ClosuresJava Closures
Java Closures
 
NLUUG print conference May 26 2016
NLUUG print conference May 26 2016NLUUG print conference May 26 2016
NLUUG print conference May 26 2016
 
Introduction to Actor Model and Akka
Introduction to Actor Model and AkkaIntroduction to Actor Model and Akka
Introduction to Actor Model and Akka
 
Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)
 

Kürzlich hochgeladen

DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
MayuraD1
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 

Kürzlich hochgeladen (20)

NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 

Akkurate Akka