SlideShare a Scribd company logo
Two Reactive approaches to scale
1
Comparing two approaches
for scalable, message-driven, backend applications
in Java
Spring Boot μServices and Akka
Lorenzo Nicora Lorenzo.nicora@opencredo.com
2
“Reactive” is…
Reactive
Semantically overloaded term
adj. “Readily responsive to stimulus” [Merrian-Webster dictionary]
From Latin “reagere”: act in return
• Reactive as Responsive
Quickly prompt to user actions
Reactive as…
• Reactive as Data binding
Declarative, as opposed to Imperative
a=b+3
e.g. Spreadsheets
• Reactive streams as Asynchronous Data Streams
• Reactive as Reactive Manifesto
ü Responsive à Low latency
ü Resilient à Stay responsive on failure
ü Elastic à Scale as needed
ü Message-Driven
• Async messages as only communication between components
Reactive Manifesto
✗ No Blocking operation
✗ No Synchronization
✗ No Resource hogging
Decoupling and isolation in…
ü Time à Allow concurrency
ü Space à Components location decoupling
Reactive Manifesto promotes
Top-down approach: from Macro
(at μService boundaries)
o Message based communication between services
o Isolation at service level
Bottom-Up approach: from Micro
(within the service)
o Message based communication between components
o Non-blocking processing
o Isolation at component level
Macro and Micro approaches
Two real world projects
Spring Boot
μService
Akka
Spring Boot μService application
ü Message-based communication between services
ü Non-blocking (where possible)
o Java 8 CompletableFutures
o Http non-blocking Servlets
o Fast-returning API endpoints
ü Event sourcing persistence
o Concursus forerunner
ü Spring Boot and Spring Cloud Config
Spring Boot μService
Java application using Akka, Cluster
ü Akka Actor programming model
ü Event-sourcing by Akka Persistence
ü Akka Cluster
ü Deployed using ConductR [Commercial]
ü Akka Http server (no container), non blocking
ü TypeSafe Config
✗ not Lagom framework
✗ not Akka Streams
Akka Cluster
TL;DR
“The actor model in computer science is a mathematical model of
concurrent computation that treats "actors" as the universal primitives of
concurrent 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. Actors may modify private state, but
can only affect each other through messages (avoiding the need for any
locks).”
[Wikipedia]
Actor model
Actor
Actor
Actor
Mailbox Mailbox
Mailbox
ü Article by Carl Hewitt (1973)
ü Erlang (1986)
ü Akka framework (2009)
A different way to concurrency
Actors, !Threads
Actor is the primary computational entity
o In Java, still a mixed world of Objects and Actors
Actors interact exclusively via asynchronous messages
o As opposed to Objects interacting through method calls
o Actors REACT on receiving a message
o No synchronisation; no lock
Actor model for dummies
Actor
Actor
Actor
Mailbox Mailbox
Mailbox
Actor handles one message a time
o Message handling code is intrinsically thread safe
o May have simple state: Instance properties in Java
Actor is lightweight
o Little overhead over creating an object
o May be used to hold request context
• Per-request Actors: a common pattern
Actor model
Collaborating Actors
≠ Dependency Injection
o Akka: Actor Refs (location/lifecycle transparent) ≠ object refs
Actors are created by Actors (…then may be passed around)
Parent à Children
Supervision hierarchy
Failure handling
Supervision
Implementing Reactive principles
Implementing Reactive principles
from Macro and from Micro
Plain Java/Spring or Akka
Never block threads waiting
Macro
o Asynchronous messaging protocols between services
Micro
Plain Java
o CompletableFuture
o Non-blocking Servlets
o Low level NIO (!)
Akka
o Actors REACT to messages: never blocks waiting.
o Have to use some discipline not to block
e.g. waiting for a response from a synchronous resource
Non-blocking
Handle timeouts,
for resiliency
Macro (at service boundaries)
o Outbound connection timeouts (client)
o Inbound request/response (ack) handling timeouts (server)
Micro
Plain Java
o Not easy to handle timeouts consistently à ...unhandled or use default
Akka
o Everything has an explicit timeout à impossible to forget
o Actor message receiving timeout handler
Timeouts handlings
Asynchronous Failure handling
Java CompletableFuture à handle exceptional completion
o Error prone; easily forgotten
o No way to separate Error and Failure handling
Actors à failure handled by Supervisor
Akka: Supervisor is notified when an Actor throws an Exception
• Failure : handled externally from message flow
• Error: part of message handling behaviour
Handling Failure, Asynchronously
Event/Command sourcing
natural persistence patterns
for distributed, asynchronous applications
Plain Java/Spring
o Write your own Event Sourcing à Concursus
Event Sourcing naturally fits Actors
o Actors may be stateful
o Events and Commands are messages
• When received à Actor change its state
• May be saved and replayed
o Actors may represent Aggregate Root (DDD) or Command Processor
ü Akka Persistence: Command and Event Sourcing out of the box
Persistence: Event-sourcing
Conclusions
Keep in mind Reactive principles
…even when not using “reactive” technologies
à Scalable and resilient applications
Many implications behind the generic principles
Reactive principles
Does a “Reactive” technology like Akka help?
at Micro
ü Simpler, more testable concurrent code
ü Requires less discipline then plain Java 8
✗ A new programming model to learn
Does Akka help?
Does a “Reactive” technology like Akka help?
at Macro
• Still requires discipline at architectural level
✗ Akka forces to reinvent a lot of wheels on integration
✗ Akka doesn’t integrate with Spring
Does Akka help?
Akka/Actor model
μServices:
NOT mutually exclusive
Consider adopting Akka for some services
• The most business-critical (+resilient)
• Highest concurrency
Akka and μServices
Reactive Manifesto
http://www.reactivemanifesto.org/
à Glossary: http://www.reactivemanifesto.org/glossary
Concurrency in Erlang & Scala: The Actor Model
https://rocketeer.be/articles/concurrency-in-erlang-scala/
Introducing Actors (Akka)
http://rerun.me/2014/09/11/introducing-actors-akka-notes-part-1/
DDD and Actor model (Vaughn Vernon, DDD eXchange 2013)
https://skillsmatter.com/skillscasts/4185-vaughn-vernon
Akka project
https://github.com/akka/akka
More…
Thanks!
Questions?

More Related Content

What's hot

How to Manage Organizational Change and Cultural Impact During a Cloud Transf...
How to Manage Organizational Change and Cultural Impact During a Cloud Transf...How to Manage Organizational Change and Cultural Impact During a Cloud Transf...
How to Manage Organizational Change and Cultural Impact During a Cloud Transf...
Amazon Web Services
 
Why Microservice
Why Microservice Why Microservice
Why Microservice
Kelvin Yeung
 
On-premise to Microsoft Azure Cloud Migration.
 On-premise to Microsoft Azure Cloud Migration. On-premise to Microsoft Azure Cloud Migration.
On-premise to Microsoft Azure Cloud Migration.
Emtec Inc.
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
Amazon Web Services
 
Event Sourcing & CQRS, Kafka, Rabbit MQ
Event Sourcing & CQRS, Kafka, Rabbit MQEvent Sourcing & CQRS, Kafka, Rabbit MQ
Event Sourcing & CQRS, Kafka, Rabbit MQ
Araf Karsh Hamid
 
Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar
Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar
Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar
Timothy McAliley
 
Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture
Solace
 
Leveraging Cloud Transformation to Build a DevOps Culture | AWS Public Sector...
Leveraging Cloud Transformation to Build a DevOps Culture | AWS Public Sector...Leveraging Cloud Transformation to Build a DevOps Culture | AWS Public Sector...
Leveraging Cloud Transformation to Build a DevOps Culture | AWS Public Sector...
Amazon Web Services
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services Architecture
Araf Karsh Hamid
 
Migrating to Microservices Patterns and Technologies (edition 2023)
 Migrating to Microservices Patterns and Technologies (edition 2023) Migrating to Microservices Patterns and Technologies (edition 2023)
Migrating to Microservices Patterns and Technologies (edition 2023)
Ahmed Misbah
 
Building Slack's internal developer platform as a product.pdf
Building Slack's internal developer platform as a product.pdfBuilding Slack's internal developer platform as a product.pdf
Building Slack's internal developer platform as a product.pdf
Javier Turégano Molina
 
AWS VS AZURE VS GCP.pptx
AWS VS AZURE VS GCP.pptxAWS VS AZURE VS GCP.pptx
AWS VS AZURE VS GCP.pptx
Raneesh Ramesan
 
Cloud Native Applications Maturity Model
Cloud Native Applications Maturity ModelCloud Native Applications Maturity Model
Cloud Native Applications Maturity Model
Jim Bugwadia
 
CAF presentation 09 16-2020
CAF presentation 09 16-2020CAF presentation 09 16-2020
CAF presentation 09 16-2020
Michael Nichols
 
Introduction to AWS Lambda and Serverless Applications
Introduction to AWS Lambda and Serverless ApplicationsIntroduction to AWS Lambda and Serverless Applications
Introduction to AWS Lambda and Serverless Applications
Amazon Web Services
 
Cloud Migration: A How-To Guide
Cloud Migration: A How-To GuideCloud Migration: A How-To Guide
Cloud Migration: A How-To Guide
Amazon Web Services
 
The People Model & Cloud Transformation - Transformation Day Public Sector Lo...
The People Model & Cloud Transformation - Transformation Day Public Sector Lo...The People Model & Cloud Transformation - Transformation Day Public Sector Lo...
The People Model & Cloud Transformation - Transformation Day Public Sector Lo...
Amazon Web Services
 
Event-driven Architecture
Event-driven ArchitectureEvent-driven Architecture
Event-driven Architecture
Centric Consulting
 
Event Driven Software Architecture Pattern
Event Driven Software Architecture PatternEvent Driven Software Architecture Pattern
Event Driven Software Architecture Pattern
jeetendra mandal
 

What's hot (20)

How to Manage Organizational Change and Cultural Impact During a Cloud Transf...
How to Manage Organizational Change and Cultural Impact During a Cloud Transf...How to Manage Organizational Change and Cultural Impact During a Cloud Transf...
How to Manage Organizational Change and Cultural Impact During a Cloud Transf...
 
Why Microservice
Why Microservice Why Microservice
Why Microservice
 
On-premise to Microsoft Azure Cloud Migration.
 On-premise to Microsoft Azure Cloud Migration. On-premise to Microsoft Azure Cloud Migration.
On-premise to Microsoft Azure Cloud Migration.
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Event Sourcing & CQRS, Kafka, Rabbit MQ
Event Sourcing & CQRS, Kafka, Rabbit MQEvent Sourcing & CQRS, Kafka, Rabbit MQ
Event Sourcing & CQRS, Kafka, Rabbit MQ
 
Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar
Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar
Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar
 
Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture
 
Leveraging Cloud Transformation to Build a DevOps Culture | AWS Public Sector...
Leveraging Cloud Transformation to Build a DevOps Culture | AWS Public Sector...Leveraging Cloud Transformation to Build a DevOps Culture | AWS Public Sector...
Leveraging Cloud Transformation to Build a DevOps Culture | AWS Public Sector...
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services Architecture
 
Migrating to Microservices Patterns and Technologies (edition 2023)
 Migrating to Microservices Patterns and Technologies (edition 2023) Migrating to Microservices Patterns and Technologies (edition 2023)
Migrating to Microservices Patterns and Technologies (edition 2023)
 
Building Slack's internal developer platform as a product.pdf
Building Slack's internal developer platform as a product.pdfBuilding Slack's internal developer platform as a product.pdf
Building Slack's internal developer platform as a product.pdf
 
AWS VS AZURE VS GCP.pptx
AWS VS AZURE VS GCP.pptxAWS VS AZURE VS GCP.pptx
AWS VS AZURE VS GCP.pptx
 
Cloud Native Applications Maturity Model
Cloud Native Applications Maturity ModelCloud Native Applications Maturity Model
Cloud Native Applications Maturity Model
 
CAF presentation 09 16-2020
CAF presentation 09 16-2020CAF presentation 09 16-2020
CAF presentation 09 16-2020
 
Introduction to AWS Lambda and Serverless Applications
Introduction to AWS Lambda and Serverless ApplicationsIntroduction to AWS Lambda and Serverless Applications
Introduction to AWS Lambda and Serverless Applications
 
Cloud Migration: A How-To Guide
Cloud Migration: A How-To GuideCloud Migration: A How-To Guide
Cloud Migration: A How-To Guide
 
The People Model & Cloud Transformation - Transformation Day Public Sector Lo...
The People Model & Cloud Transformation - Transformation Day Public Sector Lo...The People Model & Cloud Transformation - Transformation Day Public Sector Lo...
The People Model & Cloud Transformation - Transformation Day Public Sector Lo...
 
Cloud Migration Workshop
Cloud Migration WorkshopCloud Migration Workshop
Cloud Migration Workshop
 
Event-driven Architecture
Event-driven ArchitectureEvent-driven Architecture
Event-driven Architecture
 
Event Driven Software Architecture Pattern
Event Driven Software Architecture PatternEvent Driven Software Architecture Pattern
Event Driven Software Architecture Pattern
 

Similar to Spring Boot Microservices vs Akka Actor Cluster

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
 
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
 
Why Actor-Based Systems Are The Best For Microservices
Why Actor-Based Systems Are The Best For MicroservicesWhy Actor-Based Systems Are The Best For Microservices
Why Actor-Based Systems Are The Best For Microservices
Yaroslav Tkachenko
 
Reactive Principles and Microservices
Reactive Principles and MicroservicesReactive Principles and Microservices
Reactive Principles and Microservices
Lorenzo Nicora
 
Reactive microservices
Reactive microservicesReactive microservices
Reactive microservices
Haufe-Lexware GmbH & Co KG
 
Reactive Microservices By Lorenzo Nicora
Reactive Microservices By Lorenzo NicoraReactive Microservices By Lorenzo Nicora
Reactive Microservices By Lorenzo Nicora
OpenCredo
 
Akka for big data developers
Akka for big data developersAkka for big data developers
Akka for big data developers
Taras Fedorov
 
Oop2011 actor presentation_stal
Oop2011 actor presentation_stalOop2011 actor presentation_stal
Oop2011 actor presentation_stal
Michael Stal
 
Reactive java - Reactive Programming + RxJava
Reactive java - Reactive Programming + RxJavaReactive java - Reactive Programming + RxJava
Reactive java - Reactive Programming + RxJava
NexThoughts Technologies
 
Sharing-akka-pub
Sharing-akka-pubSharing-akka-pub
Sharing-akka-pub
Hendri Karisma
 
RxJava@DAUG
RxJava@DAUGRxJava@DAUG
RxJava@DAUG
Maxim Volgin
 
Rx Swift
Rx SwiftRx Swift
Rx Swift
Vincenzo Favara
 
Akka and Kubernetes, the beginning of a beautiful relationship
Akka and Kubernetes, the beginning of a beautiful relationshipAkka and Kubernetes, the beginning of a beautiful relationship
Akka and Kubernetes, the beginning of a beautiful relationship
Hugh McKee
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examples
Peter Lawrey
 
Agile Lab_BigData_Meetup_AKKA
Agile Lab_BigData_Meetup_AKKAAgile Lab_BigData_Meetup_AKKA
Agile Lab_BigData_Meetup_AKKAPaolo Platter
 
Reactive applications and Akka intro used in the Madrid Scala Meetup
Reactive applications and Akka intro used in the Madrid Scala MeetupReactive applications and Akka intro used in the Madrid Scala Meetup
Reactive applications and Akka intro used in the Madrid Scala MeetupMiguel Pastor
 
Streams of RDF Events Derive2015
Streams of RDF Events Derive2015Streams of RDF Events Derive2015
Streams of RDF Events Derive2015
Jean-Paul Calbimonte
 
CrawlerLD - Distributed crawler for linked data
CrawlerLD - Distributed crawler for linked dataCrawlerLD - Distributed crawler for linked data
CrawlerLD - Distributed crawler for linked data
Raphael do Vale
 
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)
GlobalLogic Ukraine
 

Similar to Spring Boot Microservices vs Akka Actor Cluster (20)

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
 
Why Actor-Based Systems Are The Best For Microservices
Why Actor-Based Systems Are The Best For MicroservicesWhy Actor-Based Systems Are The Best For Microservices
Why Actor-Based Systems Are The Best For Microservices
 
Reactive Principles and Microservices
Reactive Principles and MicroservicesReactive Principles and Microservices
Reactive Principles and Microservices
 
Reactive microservices
Reactive microservicesReactive microservices
Reactive microservices
 
Reactive Microservices By Lorenzo Nicora
Reactive Microservices By Lorenzo NicoraReactive Microservices By Lorenzo Nicora
Reactive Microservices By Lorenzo Nicora
 
Akka for big data developers
Akka for big data developersAkka for big data developers
Akka for big data developers
 
Oop2011 actor presentation_stal
Oop2011 actor presentation_stalOop2011 actor presentation_stal
Oop2011 actor presentation_stal
 
Reactive java - Reactive Programming + RxJava
Reactive java - Reactive Programming + RxJavaReactive java - Reactive Programming + RxJava
Reactive java - Reactive Programming + RxJava
 
Sharing-akka-pub
Sharing-akka-pubSharing-akka-pub
Sharing-akka-pub
 
RxJava@DAUG
RxJava@DAUGRxJava@DAUG
RxJava@DAUG
 
Rx Swift
Rx SwiftRx Swift
Rx Swift
 
Akka and Kubernetes, the beginning of a beautiful relationship
Akka and Kubernetes, the beginning of a beautiful relationshipAkka and Kubernetes, the beginning of a beautiful relationship
Akka and Kubernetes, the beginning of a beautiful relationship
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examples
 
Agile Lab_BigData_Meetup_AKKA
Agile Lab_BigData_Meetup_AKKAAgile Lab_BigData_Meetup_AKKA
Agile Lab_BigData_Meetup_AKKA
 
Reactive applications and Akka intro used in the Madrid Scala Meetup
Reactive applications and Akka intro used in the Madrid Scala MeetupReactive applications and Akka intro used in the Madrid Scala Meetup
Reactive applications and Akka intro used in the Madrid Scala Meetup
 
Streams of RDF Events Derive2015
Streams of RDF Events Derive2015Streams of RDF Events Derive2015
Streams of RDF Events Derive2015
 
Akka (1)
Akka (1)Akka (1)
Akka (1)
 
CrawlerLD - Distributed crawler for linked data
CrawlerLD - Distributed crawler for linked dataCrawlerLD - Distributed crawler for linked data
CrawlerLD - Distributed crawler for linked data
 
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)
 

More from OpenCredo

Webinar - Design Thinking for Platform Engineering
Webinar - Design Thinking for Platform EngineeringWebinar - Design Thinking for Platform Engineering
Webinar - Design Thinking for Platform Engineering
OpenCredo
 
MuCon 2019: Exploring Your Microservices Architecture Through Network Science...
MuCon 2019: Exploring Your Microservices Architecture Through Network Science...MuCon 2019: Exploring Your Microservices Architecture Through Network Science...
MuCon 2019: Exploring Your Microservices Architecture Through Network Science...
OpenCredo
 
Goto Chicago; Journeys To Cloud Native Architecture: Sun, Sea And Emergencies...
Goto Chicago; Journeys To Cloud Native Architecture: Sun, Sea And Emergencies...Goto Chicago; Journeys To Cloud Native Architecture: Sun, Sea And Emergencies...
Goto Chicago; Journeys To Cloud Native Architecture: Sun, Sea And Emergencies...
OpenCredo
 
Mucon 2018: Heuristics for Identifying Microservice Boundaries By Erich Eichi...
Mucon 2018: Heuristics for Identifying Microservice Boundaries By Erich Eichi...Mucon 2018: Heuristics for Identifying Microservice Boundaries By Erich Eichi...
Mucon 2018: Heuristics for Identifying Microservice Boundaries By Erich Eichi...
OpenCredo
 
Journeys To Cloud Native Architecture: Sun, Sea And Emergencies - Nicki Watt
Journeys To Cloud Native Architecture: Sun, Sea And Emergencies - Nicki WattJourneys To Cloud Native Architecture: Sun, Sea And Emergencies - Nicki Watt
Journeys To Cloud Native Architecture: Sun, Sea And Emergencies - Nicki Watt
OpenCredo
 
Machine Learning Game Changer for IT - Maartens Lourens
Machine Learning Game Changer for IT - Maartens LourensMachine Learning Game Changer for IT - Maartens Lourens
Machine Learning Game Changer for IT - Maartens Lourens
OpenCredo
 
Kafka Summit 2018: A Journey Building Kafka Connectors - Pegerto Fernandez
Kafka Summit 2018: A Journey Building Kafka Connectors - Pegerto FernandezKafka Summit 2018: A Journey Building Kafka Connectors - Pegerto Fernandez
Kafka Summit 2018: A Journey Building Kafka Connectors - Pegerto Fernandez
OpenCredo
 
MuCon 2017: A not So(A) Trivial Question by Tareq Abedrabbo
MuCon 2017: A not So(A) Trivial Question by Tareq AbedrabboMuCon 2017: A not So(A) Trivial Question by Tareq Abedrabbo
MuCon 2017: A not So(A) Trivial Question by Tareq Abedrabbo
OpenCredo
 
DevOpsCon Berlin 2017: Project Management from Stone Age to DevOps By Antoni...
DevOpsCon Berlin 2017: Project Management from Stone Age to DevOps  By Antoni...DevOpsCon Berlin 2017: Project Management from Stone Age to DevOps  By Antoni...
DevOpsCon Berlin 2017: Project Management from Stone Age to DevOps By Antoni...
OpenCredo
 
Hashidays London 2017 - Evolving your Infrastructure with Terraform By Nicki ...
Hashidays London 2017 - Evolving your Infrastructure with Terraform By Nicki ...Hashidays London 2017 - Evolving your Infrastructure with Terraform By Nicki ...
Hashidays London 2017 - Evolving your Infrastructure with Terraform By Nicki ...
OpenCredo
 
Succeeding with DevOps Transformation - Rafal Gancarz
Succeeding with DevOps Transformation - Rafal GancarzSucceeding with DevOps Transformation - Rafal Gancarz
Succeeding with DevOps Transformation - Rafal Gancarz
OpenCredo
 
Progscon 2017: Serverless Architectures - Rafal Gancarz
Progscon 2017: Serverless Architectures - Rafal GancarzProgscon 2017: Serverless Architectures - Rafal Gancarz
Progscon 2017: Serverless Architectures - Rafal Gancarz
OpenCredo
 
QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz
QCON London 2017 - Monitoring Serverless Architectures by Rafal GancarzQCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz
QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz
OpenCredo
 
Voxxed Bristol 2017 - From C to Q, one event at a time: Event Sourcing illust...
Voxxed Bristol 2017 - From C to Q, one event at a time: Event Sourcing illust...Voxxed Bristol 2017 - From C to Q, one event at a time: Event Sourcing illust...
Voxxed Bristol 2017 - From C to Q, one event at a time: Event Sourcing illust...
OpenCredo
 
London Hashicorp Meetup #8 - Testing Programmable Infrastructure By Matt Long
London Hashicorp Meetup #8 -  Testing Programmable Infrastructure By Matt LongLondon Hashicorp Meetup #8 -  Testing Programmable Infrastructure By Matt Long
London Hashicorp Meetup #8 - Testing Programmable Infrastructure By Matt Long
OpenCredo
 
ServerlessConf: Serverless for the Enterprise - Rafal Gancarz
ServerlessConf: Serverless for the Enterprise - Rafal GancarzServerlessConf: Serverless for the Enterprise - Rafal Gancarz
ServerlessConf: Serverless for the Enterprise - Rafal Gancarz
OpenCredo
 
O'Reilly 2016: "Continuous Delivery with Containers: The Trials and Tribulati...
O'Reilly 2016: "Continuous Delivery with Containers: The Trials and Tribulati...O'Reilly 2016: "Continuous Delivery with Containers: The Trials and Tribulati...
O'Reilly 2016: "Continuous Delivery with Containers: The Trials and Tribulati...
OpenCredo
 
Haufe #msaday - The Actor model: an alternative approach to concurrency By Lo...
Haufe #msaday - The Actor model: an alternative approach to concurrency By Lo...Haufe #msaday - The Actor model: an alternative approach to concurrency By Lo...
Haufe #msaday - The Actor model: an alternative approach to concurrency By Lo...
OpenCredo
 
Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant
Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant
Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant
OpenCredo
 
Haufe #msaday - Building a Microservice Ecosystem by Daniel Bryant
Haufe #msaday - Building a Microservice Ecosystem by Daniel Bryant Haufe #msaday - Building a Microservice Ecosystem by Daniel Bryant
Haufe #msaday - Building a Microservice Ecosystem by Daniel Bryant
OpenCredo
 

More from OpenCredo (20)

Webinar - Design Thinking for Platform Engineering
Webinar - Design Thinking for Platform EngineeringWebinar - Design Thinking for Platform Engineering
Webinar - Design Thinking for Platform Engineering
 
MuCon 2019: Exploring Your Microservices Architecture Through Network Science...
MuCon 2019: Exploring Your Microservices Architecture Through Network Science...MuCon 2019: Exploring Your Microservices Architecture Through Network Science...
MuCon 2019: Exploring Your Microservices Architecture Through Network Science...
 
Goto Chicago; Journeys To Cloud Native Architecture: Sun, Sea And Emergencies...
Goto Chicago; Journeys To Cloud Native Architecture: Sun, Sea And Emergencies...Goto Chicago; Journeys To Cloud Native Architecture: Sun, Sea And Emergencies...
Goto Chicago; Journeys To Cloud Native Architecture: Sun, Sea And Emergencies...
 
Mucon 2018: Heuristics for Identifying Microservice Boundaries By Erich Eichi...
Mucon 2018: Heuristics for Identifying Microservice Boundaries By Erich Eichi...Mucon 2018: Heuristics for Identifying Microservice Boundaries By Erich Eichi...
Mucon 2018: Heuristics for Identifying Microservice Boundaries By Erich Eichi...
 
Journeys To Cloud Native Architecture: Sun, Sea And Emergencies - Nicki Watt
Journeys To Cloud Native Architecture: Sun, Sea And Emergencies - Nicki WattJourneys To Cloud Native Architecture: Sun, Sea And Emergencies - Nicki Watt
Journeys To Cloud Native Architecture: Sun, Sea And Emergencies - Nicki Watt
 
Machine Learning Game Changer for IT - Maartens Lourens
Machine Learning Game Changer for IT - Maartens LourensMachine Learning Game Changer for IT - Maartens Lourens
Machine Learning Game Changer for IT - Maartens Lourens
 
Kafka Summit 2018: A Journey Building Kafka Connectors - Pegerto Fernandez
Kafka Summit 2018: A Journey Building Kafka Connectors - Pegerto FernandezKafka Summit 2018: A Journey Building Kafka Connectors - Pegerto Fernandez
Kafka Summit 2018: A Journey Building Kafka Connectors - Pegerto Fernandez
 
MuCon 2017: A not So(A) Trivial Question by Tareq Abedrabbo
MuCon 2017: A not So(A) Trivial Question by Tareq AbedrabboMuCon 2017: A not So(A) Trivial Question by Tareq Abedrabbo
MuCon 2017: A not So(A) Trivial Question by Tareq Abedrabbo
 
DevOpsCon Berlin 2017: Project Management from Stone Age to DevOps By Antoni...
DevOpsCon Berlin 2017: Project Management from Stone Age to DevOps  By Antoni...DevOpsCon Berlin 2017: Project Management from Stone Age to DevOps  By Antoni...
DevOpsCon Berlin 2017: Project Management from Stone Age to DevOps By Antoni...
 
Hashidays London 2017 - Evolving your Infrastructure with Terraform By Nicki ...
Hashidays London 2017 - Evolving your Infrastructure with Terraform By Nicki ...Hashidays London 2017 - Evolving your Infrastructure with Terraform By Nicki ...
Hashidays London 2017 - Evolving your Infrastructure with Terraform By Nicki ...
 
Succeeding with DevOps Transformation - Rafal Gancarz
Succeeding with DevOps Transformation - Rafal GancarzSucceeding with DevOps Transformation - Rafal Gancarz
Succeeding with DevOps Transformation - Rafal Gancarz
 
Progscon 2017: Serverless Architectures - Rafal Gancarz
Progscon 2017: Serverless Architectures - Rafal GancarzProgscon 2017: Serverless Architectures - Rafal Gancarz
Progscon 2017: Serverless Architectures - Rafal Gancarz
 
QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz
QCON London 2017 - Monitoring Serverless Architectures by Rafal GancarzQCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz
QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz
 
Voxxed Bristol 2017 - From C to Q, one event at a time: Event Sourcing illust...
Voxxed Bristol 2017 - From C to Q, one event at a time: Event Sourcing illust...Voxxed Bristol 2017 - From C to Q, one event at a time: Event Sourcing illust...
Voxxed Bristol 2017 - From C to Q, one event at a time: Event Sourcing illust...
 
London Hashicorp Meetup #8 - Testing Programmable Infrastructure By Matt Long
London Hashicorp Meetup #8 -  Testing Programmable Infrastructure By Matt LongLondon Hashicorp Meetup #8 -  Testing Programmable Infrastructure By Matt Long
London Hashicorp Meetup #8 - Testing Programmable Infrastructure By Matt Long
 
ServerlessConf: Serverless for the Enterprise - Rafal Gancarz
ServerlessConf: Serverless for the Enterprise - Rafal GancarzServerlessConf: Serverless for the Enterprise - Rafal Gancarz
ServerlessConf: Serverless for the Enterprise - Rafal Gancarz
 
O'Reilly 2016: "Continuous Delivery with Containers: The Trials and Tribulati...
O'Reilly 2016: "Continuous Delivery with Containers: The Trials and Tribulati...O'Reilly 2016: "Continuous Delivery with Containers: The Trials and Tribulati...
O'Reilly 2016: "Continuous Delivery with Containers: The Trials and Tribulati...
 
Haufe #msaday - The Actor model: an alternative approach to concurrency By Lo...
Haufe #msaday - The Actor model: an alternative approach to concurrency By Lo...Haufe #msaday - The Actor model: an alternative approach to concurrency By Lo...
Haufe #msaday - The Actor model: an alternative approach to concurrency By Lo...
 
Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant
Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant
Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant
 
Haufe #msaday - Building a Microservice Ecosystem by Daniel Bryant
Haufe #msaday - Building a Microservice Ecosystem by Daniel Bryant Haufe #msaday - Building a Microservice Ecosystem by Daniel Bryant
Haufe #msaday - Building a Microservice Ecosystem by Daniel Bryant
 

Recently uploaded

BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
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
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Jay Das
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 

Recently uploaded (20)

BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 

Spring Boot Microservices vs Akka Actor Cluster

  • 1. Two Reactive approaches to scale 1 Comparing two approaches for scalable, message-driven, backend applications in Java Spring Boot μServices and Akka Lorenzo Nicora Lorenzo.nicora@opencredo.com
  • 2. 2 “Reactive” is… Reactive Semantically overloaded term adj. “Readily responsive to stimulus” [Merrian-Webster dictionary] From Latin “reagere”: act in return
  • 3. • Reactive as Responsive Quickly prompt to user actions Reactive as… • Reactive as Data binding Declarative, as opposed to Imperative a=b+3 e.g. Spreadsheets • Reactive streams as Asynchronous Data Streams • Reactive as Reactive Manifesto
  • 4. ü Responsive à Low latency ü Resilient à Stay responsive on failure ü Elastic à Scale as needed ü Message-Driven • Async messages as only communication between components Reactive Manifesto
  • 5. ✗ No Blocking operation ✗ No Synchronization ✗ No Resource hogging Decoupling and isolation in… ü Time à Allow concurrency ü Space à Components location decoupling Reactive Manifesto promotes
  • 6. Top-down approach: from Macro (at μService boundaries) o Message based communication between services o Isolation at service level Bottom-Up approach: from Micro (within the service) o Message based communication between components o Non-blocking processing o Isolation at component level Macro and Micro approaches
  • 7. Two real world projects Spring Boot μService Akka
  • 8. Spring Boot μService application ü Message-based communication between services ü Non-blocking (where possible) o Java 8 CompletableFutures o Http non-blocking Servlets o Fast-returning API endpoints ü Event sourcing persistence o Concursus forerunner ü Spring Boot and Spring Cloud Config Spring Boot μService
  • 9. Java application using Akka, Cluster ü Akka Actor programming model ü Event-sourcing by Akka Persistence ü Akka Cluster ü Deployed using ConductR [Commercial] ü Akka Http server (no container), non blocking ü TypeSafe Config ✗ not Lagom framework ✗ not Akka Streams Akka Cluster
  • 10. TL;DR “The actor model in computer science is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent 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. Actors may modify private state, but can only affect each other through messages (avoiding the need for any locks).” [Wikipedia] Actor model Actor Actor Actor Mailbox Mailbox Mailbox ü Article by Carl Hewitt (1973) ü Erlang (1986) ü Akka framework (2009)
  • 11. A different way to concurrency Actors, !Threads Actor is the primary computational entity o In Java, still a mixed world of Objects and Actors Actors interact exclusively via asynchronous messages o As opposed to Objects interacting through method calls o Actors REACT on receiving a message o No synchronisation; no lock Actor model for dummies Actor Actor Actor Mailbox Mailbox Mailbox
  • 12. Actor handles one message a time o Message handling code is intrinsically thread safe o May have simple state: Instance properties in Java Actor is lightweight o Little overhead over creating an object o May be used to hold request context • Per-request Actors: a common pattern Actor model
  • 13. Collaborating Actors ≠ Dependency Injection o Akka: Actor Refs (location/lifecycle transparent) ≠ object refs Actors are created by Actors (…then may be passed around) Parent à Children Supervision hierarchy Failure handling Supervision
  • 14. Implementing Reactive principles Implementing Reactive principles from Macro and from Micro Plain Java/Spring or Akka
  • 15. Never block threads waiting Macro o Asynchronous messaging protocols between services Micro Plain Java o CompletableFuture o Non-blocking Servlets o Low level NIO (!) Akka o Actors REACT to messages: never blocks waiting. o Have to use some discipline not to block e.g. waiting for a response from a synchronous resource Non-blocking
  • 16. Handle timeouts, for resiliency Macro (at service boundaries) o Outbound connection timeouts (client) o Inbound request/response (ack) handling timeouts (server) Micro Plain Java o Not easy to handle timeouts consistently à ...unhandled or use default Akka o Everything has an explicit timeout à impossible to forget o Actor message receiving timeout handler Timeouts handlings
  • 17. Asynchronous Failure handling Java CompletableFuture à handle exceptional completion o Error prone; easily forgotten o No way to separate Error and Failure handling Actors à failure handled by Supervisor Akka: Supervisor is notified when an Actor throws an Exception • Failure : handled externally from message flow • Error: part of message handling behaviour Handling Failure, Asynchronously
  • 18. Event/Command sourcing natural persistence patterns for distributed, asynchronous applications Plain Java/Spring o Write your own Event Sourcing à Concursus Event Sourcing naturally fits Actors o Actors may be stateful o Events and Commands are messages • When received à Actor change its state • May be saved and replayed o Actors may represent Aggregate Root (DDD) or Command Processor ü Akka Persistence: Command and Event Sourcing out of the box Persistence: Event-sourcing
  • 20. Keep in mind Reactive principles …even when not using “reactive” technologies à Scalable and resilient applications Many implications behind the generic principles Reactive principles
  • 21. Does a “Reactive” technology like Akka help? at Micro ü Simpler, more testable concurrent code ü Requires less discipline then plain Java 8 ✗ A new programming model to learn Does Akka help?
  • 22. Does a “Reactive” technology like Akka help? at Macro • Still requires discipline at architectural level ✗ Akka forces to reinvent a lot of wheels on integration ✗ Akka doesn’t integrate with Spring Does Akka help?
  • 23. Akka/Actor model μServices: NOT mutually exclusive Consider adopting Akka for some services • The most business-critical (+resilient) • Highest concurrency Akka and μServices
  • 24. Reactive Manifesto http://www.reactivemanifesto.org/ à Glossary: http://www.reactivemanifesto.org/glossary Concurrency in Erlang & Scala: The Actor Model https://rocketeer.be/articles/concurrency-in-erlang-scala/ Introducing Actors (Akka) http://rerun.me/2014/09/11/introducing-actors-akka-notes-part-1/ DDD and Actor model (Vaughn Vernon, DDD eXchange 2013) https://skillsmatter.com/skillscasts/4185-vaughn-vernon Akka project https://github.com/akka/akka More…