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 (20)

PPTX
Docker.pptx
balaji257
 
RTF
Introduction to Database Log Analysis
Anton Chuvakin
 
PPTX
Kafka Retry and DLQ
George Teo
 
PPTX
Elk
Caleb Wang
 
PDF
Oracle to Postgres Migration - part 1
PgTraining
 
PPTX
OLTP+OLAP=HTAP
EDB
 
PDF
Oracle RAC on Extended Distance Clusters - Presentation
Markus Michalewicz
 
PDF
Introduction to Resilience4j
Knoldus Inc.
 
PDF
Docker swarm introduction
Evan Lin
 
PPTX
Monitoring_with_Prometheus_Grafana_Tutorial
Tim Vaillancourt
 
PDF
Oracle Latch and Mutex Contention Troubleshooting
Tanel Poder
 
PPTX
Postgre sql vs oracle
Jacques Kostic
 
PDF
GoldenGate and Stream Processing with Special Guest Rakuten
Jeffrey T. Pollock
 
PDF
HDFS User Reference
Biju Nair
 
PDF
Oracle Exadata Exam Dump
Pooja C
 
PDF
Storage tiering and erasure coding in Ceph (SCaLE13x)
Sage Weil
 
PDF
SIPREC RTPEngine Media Forking
Hossein Yavari
 
PDF
Docker volume
MyoungSu Shin
 
PDF
[Podman Special Event] Kubernetes in Rootless Podman
Akihiro Suda
 
PDF
MAA Best Practices for Oracle Database 19c
Markus Michalewicz
 
Docker.pptx
balaji257
 
Introduction to Database Log Analysis
Anton Chuvakin
 
Kafka Retry and DLQ
George Teo
 
Oracle to Postgres Migration - part 1
PgTraining
 
OLTP+OLAP=HTAP
EDB
 
Oracle RAC on Extended Distance Clusters - Presentation
Markus Michalewicz
 
Introduction to Resilience4j
Knoldus Inc.
 
Docker swarm introduction
Evan Lin
 
Monitoring_with_Prometheus_Grafana_Tutorial
Tim Vaillancourt
 
Oracle Latch and Mutex Contention Troubleshooting
Tanel Poder
 
Postgre sql vs oracle
Jacques Kostic
 
GoldenGate and Stream Processing with Special Guest Rakuten
Jeffrey T. Pollock
 
HDFS User Reference
Biju Nair
 
Oracle Exadata Exam Dump
Pooja C
 
Storage tiering and erasure coding in Ceph (SCaLE13x)
Sage Weil
 
SIPREC RTPEngine Media Forking
Hossein Yavari
 
Docker volume
MyoungSu Shin
 
[Podman Special Event] Kubernetes in Rootless Podman
Akihiro Suda
 
MAA Best Practices for Oracle Database 19c
Markus Michalewicz
 

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

PDF
Beyond Fault Tolerance with Actor Programming
Fabio Tiriticco
 
PDF
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...
Codemotion
 
PDF
Why Actor-Based Systems Are The Best For Microservices
Yaroslav Tkachenko
 
PDF
Reactive Principles and Microservices
Lorenzo Nicora
 
PDF
Reactive microservices
Haufe-Lexware GmbH & Co KG
 
PDF
Reactive Microservices By Lorenzo Nicora
OpenCredo
 
PPTX
Akka for big data developers
Taras Fedorov
 
PPTX
Oop2011 actor presentation_stal
Michael Stal
 
PDF
Reactive java - Reactive Programming + RxJava
NexThoughts Technologies
 
PDF
Sharing-akka-pub
Hendri Karisma
 
PDF
RxJava@DAUG
Maxim Volgin
 
PDF
Rx Swift
Vincenzo Favara
 
PDF
Akka and Kubernetes, the beginning of a beautiful relationship
Hugh McKee
 
PPT
Reactive programming with examples
Peter Lawrey
 
PDF
Agile Lab_BigData_Meetup_AKKA
Paolo Platter
 
PDF
Reactive applications and Akka intro used in the Madrid Scala Meetup
Miguel Pastor
 
PPTX
Streams of RDF Events Derive2015
Jean-Paul Calbimonte
 
PDF
Akka (1)
Rahul Shukla
 
PPTX
CrawlerLD - Distributed crawler for linked data
Raphael do Vale
 
PDF
Take a Look at Akka+Java (English version)
GlobalLogic Ukraine
 
Beyond Fault Tolerance with Actor Programming
Fabio Tiriticco
 
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...
Codemotion
 
Why Actor-Based Systems Are The Best For Microservices
Yaroslav Tkachenko
 
Reactive Principles and Microservices
Lorenzo Nicora
 
Reactive microservices
Haufe-Lexware GmbH & Co KG
 
Reactive Microservices By Lorenzo Nicora
OpenCredo
 
Akka for big data developers
Taras Fedorov
 
Oop2011 actor presentation_stal
Michael Stal
 
Reactive java - Reactive Programming + RxJava
NexThoughts Technologies
 
Sharing-akka-pub
Hendri Karisma
 
RxJava@DAUG
Maxim Volgin
 
Rx Swift
Vincenzo Favara
 
Akka and Kubernetes, the beginning of a beautiful relationship
Hugh McKee
 
Reactive programming with examples
Peter Lawrey
 
Agile Lab_BigData_Meetup_AKKA
Paolo Platter
 
Reactive applications and Akka intro used in the Madrid Scala Meetup
Miguel Pastor
 
Streams of RDF Events Derive2015
Jean-Paul Calbimonte
 
Akka (1)
Rahul Shukla
 
CrawlerLD - Distributed crawler for linked data
Raphael do Vale
 
Take a Look at Akka+Java (English version)
GlobalLogic Ukraine
 
Ad

More from OpenCredo (20)

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

Recently uploaded (20)

PPTX
MailsDaddy Outlook OST to PST converter.pptx
abhishekdutt366
 
PPTX
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
PDF
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
PPTX
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
PPTX
MiniTool Power Data Recovery Full Crack Latest 2025
muhammadgurbazkhan
 
PDF
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
PDF
Efficient, Automated Claims Processing Software for Insurers
Insurance Tech Services
 
PDF
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
PPT
MergeSortfbsjbjsfk sdfik k
RafishaikIT02044
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PPTX
Platform for Enterprise Solution - Java EE5
abhishekoza1981
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PDF
Salesforce CRM Services.VALiNTRY360
VALiNTRY360
 
MailsDaddy Outlook OST to PST converter.pptx
abhishekdutt366
 
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
MiniTool Power Data Recovery Full Crack Latest 2025
muhammadgurbazkhan
 
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
Efficient, Automated Claims Processing Software for Insurers
Insurance Tech Services
 
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
MergeSortfbsjbjsfk sdfik k
RafishaikIT02044
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Tally software_Introduction_Presentation
AditiBansal54083
 
Platform for Enterprise Solution - Java EE5
abhishekoza1981
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
Salesforce CRM Services.VALiNTRY360
VALiNTRY360
 

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 [email protected]
  • 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…