SlideShare a Scribd company logo
1 of 110
Download to read offline
AKKA ANTI-PATTERNS, GOODBYE:
SIX FEATURES OF AKKA 2.6
WEBINAR
MANUEL BERNHARDT
WHY?
Webinar - https://manuel.bernhardt.io - @elmanu
WHY?
Webinar - https://manuel.bernhardt.io - @elmanu
WHY?
> collected recuring "worst practices"
over the years 1
> ranges from beginner mistakes to
design issues that can affect a
project over years
> most of it has been adressed in Akka
2.6! Let's have a look at 6 of them
1
https://manuel.bernhardt.io/akka-anti-patterns
Webinar - https://manuel.bernhardt.io - @elmanu
MANUEL.BERNHARDT.IO
> Helping companies to get started with
reactive systems...
> ... or to solve critical production
issues
> Lightbend consulting and training
partner
Webinar - https://manuel.bernhardt.io - @elmanu
MANUEL.BERNHARDT.IO
> Helping companies to get started with
reactive systems...
> ... or to solve critical production
issues
> Lightbend consulting and training
partner
Webinar - https://manuel.bernhardt.io - @elmanu
AKKA 2.6
> previous major release (2.5.0) in April 2017
> introduces Akka Typed API, but does not deprecate the
Classic one
> Artery as default transport
> many, many improvements and fixes
Webinar - https://manuel.bernhardt.io - @elmanu
Webinar - https://manuel.bernhardt.io - @elmanu
If you fail to plan, you are
planning to fail!
— Benjamin Franklin
Webinar - https://manuel.bernhardt.io - @elmanu
ANTI-PATTERN #1
NOT DEFINING A PROTOCOL
Webinar - https://manuel.bernhardt.io - @elmanu
> quite often, actor systems are built without giving
much thought to the message protocol itself
> this works quite well in the beginning, but can become
quite a burden in the long run
Webinar - https://manuel.bernhardt.io - @elmanu
HOW THINGS MAY GO WRONG
> tight coupling: message re-use that makes it harder to
evolve over time
> responsibilities: responsibilities that belong together
may be split accross actors over time
> inefficiencies: "organic" growth of an actor system
makes it easy to loose track of how information is
exchanged, can lead to unnecessary message exchanges
Webinar - https://manuel.bernhardt.io - @elmanu
It is really difficult to evolve protocols in the classic
API due its dynamic nature / very open definition
Webinar - https://manuel.bernhardt.io - @elmanu
"NOT DEFINING A PROTOCOL" IN AKKA 2.6 /
TYPED
⠀
Webinar - https://manuel.bernhardt.io - @elmanu
"NOT DEFINING A PROTOCOL" IN AKKA 2.6 /
TYPED
> you can't.
Webinar - https://manuel.bernhardt.io - @elmanu
"NOT DEFINING A PROTOCOL" IN AKKA 2.6 /
TYPED
> you can't.
> Akka Typed forces you to define a protocol
> you need to specify:
> what type of message an actor can handle
> what type of response a message expects
Webinar - https://manuel.bernhardt.io - @elmanu
TYPE OF MESSAGE AN ACTOR CAN HANDLE
// marker of the message protocol
sealed trait ConfigurationCommand
// actor supporting this protocol
class Configuration(
context: ActorContext[ConfigurationCommand]
) extends AbstractBehavior[ConfigurationCommand] { ... }
Webinar - https://manuel.bernhardt.io - @elmanu
TYPE OF MESSAGE AN ACTOR EXPECTS (1)
// a message of the Configuration protocol
final case class RetrieveConfiguration(
merchantId: MerchantId,
replyTo: ActorRef[ConfigurationResponse]
) extends ConfigurationCommand
Webinar - https://manuel.bernhardt.io - @elmanu
TYPE OF MESSAGE AN ACTOR EXPECTS (2)
sealed trait ConfigurationResponse
final case class ConfigurationFound(
configuration: MerchantConfiguration
) extends ConfigurationResponse
Webinar - https://manuel.bernhardt.io - @elmanu
HOW DOES THIS CHANGE THE GAME?
> the beginner mistake of sending messages to the wrong
actor can no longer happen
> message paths are now checked by the compiler
> you can infer the protocol flow from the
ActorRef[Message] included in the messages
Webinar - https://manuel.bernhardt.io - @elmanu
sealed trait BankingCommand
final case class Login(
credentials: Credentials,
replyTo: ActorRef[LoginResponse]
) extends BankingCommand
sealed trait LoginResponse
final case class Authenticated(
session: ActorRef[SessionCommand]
) extends LoginResponse
sealed trait SessionCommand
final case class CreateTransaction(
transaction: Transaction
) extends SessionCommand
Webinar - https://manuel.bernhardt.io - @elmanu
Webinar - https://manuel.bernhardt.io - @elmanu
Time is a storm in which we are all
lost.
— William Carlos Williams
Webinar - https://manuel.bernhardt.io - @elmanu
ANTI-PATTERN #2
RACE CONDITIONS
Webinar - https://manuel.bernhardt.io - @elmanu
> in the actor model, actors handle messages one after
another
> it is safe to use mutable state inside of an actor
> unless you do the following
Webinar - https://manuel.bernhardt.io - @elmanu
CLASSIC API
class TransactionManager(processor: ActorRef) extends Actor {
var transactions = List.empty[Transaction]
def receive: Receive = {
case ProcessTransaction(transactionRequest) =>
val response: Future[ProcessingResponse] =
processor ? Process(transactionRequest)
response.map {
// here be dragons!
transactions = response.transaction :: transactions
}
}
}
Webinar - https://manuel.bernhardt.io - @elmanu
WHAT'S THE PROBLEM?
> using asynchronous constructs inside of the actor
(single-threaded illusion) is error-prone
> quite easy to make mistakes of this kind (I've seen it
many, many times)
> the recommended way is to use ask in combination with
the pipe pattern, but people may forget / not know
Webinar - https://manuel.bernhardt.io - @elmanu
"MISUSING ASK / FUTURES" IN AKKA 2.6 /
TYPED
⠀
Webinar - https://manuel.bernhardt.io - @elmanu
"MISUSING ASK / FUTURES" IN AKKA 2.6 /
TYPED
> you can't.
Webinar - https://manuel.bernhardt.io - @elmanu
class TransactionManager(
processor: ActorRef[ProcessorCommand]
) extends AbstractBehavior[ManagerCommand] {
var transactions = List.empty[Transaction]
def receive: Receive = {
case ProcessTransaction(transactionRequest) =>
context.ask(processor, Process(transactionRequest)) {
case Success(ProcessingResponse(transaction)) =>
AddTransaction(transaction)
case Failure(_) => TransactionFailed(transactionRequest)
}
case AddTransaction(transaction) =>
transactions = response.transaction :: transactions
case TransactionFailed(request) => // ...
}
}
Webinar - https://manuel.bernhardt.io - @elmanu
Webinar - https://manuel.bernhardt.io - @elmanu
"...some men aren't looking for
anything logical, like money. They
can't be bought, bullied, reasoned,
or negotiated with. Some men just
want to watch the world burn."
— Alfred Pennyworth, Batman, The Dark Knight
Webinar - https://manuel.bernhardt.io - @elmanu
ANTI-PATTERN #3
BLOCKINGWebinar - https://manuel.bernhardt.io - @elmanu
HOW CAN THIS HAPPEN?
> calling a synchronous API
> or calling an API that calls an API that calls an API...
that calls a synchronous API
> explicitly waiting for the completion of a Future
(Await.result)
Webinar - https://manuel.bernhardt.io - @elmanu
BRINGING DOWN AKKA 2.6 BY BLOCKING
⠀
Webinar - https://manuel.bernhardt.io - @elmanu
BRINGING DOWN AKKA 2.6 BY BLOCKING
> you can't.
Webinar - https://manuel.bernhardt.io - @elmanu
BRINGING DOWN AKKA 2.6 BY BLOCKING
> you can't.
> new internal dispatcher for all of Akka's internal
actors
> you can still starve your own actors, but Akka's
internal mechanisms will continue working
Webinar - https://manuel.bernhardt.io - @elmanu
IF YOU REALLY NEED TO BLOCK
blocking-io-dispatcher {
type = Dispatcher
executor = "thread-pool-executor"
thread-pool-executor {
fixed-pool-size = 8
}
throughput = 1
}
Webinar - https://manuel.bernhardt.io - @elmanu
IF YOU REALLY NEED TO BLOCK
context.spawn(
blockingBehavior,
"blocking-actor",
DispatcherSelector.fromConfig(
"blocking-io-dispatcher"
)
)
Webinar - https://manuel.bernhardt.io - @elmanu
Webinar - https://manuel.bernhardt.io - @elmanu
This is the way the world ends
Not with a bang but a whimper.
— T.S. Eliot
Webinar - https://manuel.bernhardt.io - @elmanu
ANTI-PATTERN #4
USING JAVA SERIALIZATION
Webinar - https://manuel.bernhardt.io - @elmanu
HOW COULD THIS HAPPEN?
> leaving the default on
> ignoring the nagging warning messages in the logs
> affects both serialization of messages over the wire
and for persistence
Webinar - https://manuel.bernhardt.io - @elmanu
WHY IS IT BAD?
> performance penalty!
> poor candidate for protocol evolution - message
evolutions result in older components not able to
process them any longer
> persistance - messages and snapshots can't be
processed any longer after changes
> poor security
Webinar - https://manuel.bernhardt.io - @elmanu
USING JAVA SERIALIZATION IN AKKA 2.6
⠀
Webinar - https://manuel.bernhardt.io - @elmanu
USING JAVA SERIALIZATION IN AKKA 2.6
> you can't.
Webinar - https://manuel.bernhardt.io - @elmanu
USING JAVA SERIALIZATION IN AKKA 2.6
> you can't.
> ... or at least not by default
> Jackson is the new default, with a decently performing
binary serialization format (CBOR), should be good in
most cases
Webinar - https://manuel.bernhardt.io - @elmanu
USING JACKSON SERIALIZATION
/** marker interface **/
public interface CborSerializable {}
class Message implements CborSerializable {
public final String id;
public Message(String id) {
this.id = id;
}
}
Webinar - https://manuel.bernhardt.io - @elmanu
USING JACKSON SERIALIZATION
akka.actor {
serialization-bindings {
"com.example.CborSerializable" = jackson-cbor
}
}
Webinar - https://manuel.bernhardt.io - @elmanu
JACKSON VS. PROTOCOL BUFFERS
> protobuf as a very popular binary serialization in
Akka projects in the past
> it turns out that Jackson is a very decent alternative
and involves much less work than protobuf - also in
terms of evolutions
> definitely worth checking it out in detail before falling
back to protobuf
Webinar - https://manuel.bernhardt.io - @elmanu
Webinar - https://manuel.bernhardt.io - @elmanu
The desire of excessive power
caused the angels to fall
— Francis Bacon
Webinar - https://manuel.bernhardt.io - @elmanu
ANTI-PATTERN #5
USING AKKA REMOTING** DIRECTLY
Webinar - https://manuel.bernhardt.io - @elmanu
WHAT'S THE PROBLEM?
> Akka Remoting allows to build pair-to-pair
connections between nodes / Actor Systems
> there's a lot more things to do when it comes to
building stable applications on top of the network
> not trivial
Webinar - https://manuel.bernhardt.io - @elmanu
Webinar - https://manuel.bernhardt.io - @elmanu
DIRECTLY USING AKKA REMOTING IN AKKA
2.6
⠀
Webinar - https://manuel.bernhardt.io - @elmanu
DIRECTLY USING AKKA REMOTING IN AKKA
2.6
> you can't.
Webinar - https://manuel.bernhardt.io - @elmanu
DIRECTLY USING AKKA REMOTING IN AKKA
2.6
> you can't.
> remote watch and deployment will only work when
using the Cluster extension
Webinar - https://manuel.bernhardt.io - @elmanu
AKKA CLUSTER
> membership service
> primitives for building distributed
systems: membership, singleton,
sharding, CRDTs, etc.
> check out the articles series2
about
it
2
https://manuel.bernhardt.io/articles/#akka-cluster
Webinar - https://manuel.bernhardt.io - @elmanu
Webinar - https://manuel.bernhardt.io - @elmanu
There are two ways to be fooled.
One is to believe what isn't true;
the other is to refuse to believe
what is true.
— Soren Kierkegaard
Webinar - https://manuel.bernhardt.io - @elmanu
ANTI-PATTERN #6
USING AUTO-DOWNING
Webinar - https://manuel.bernhardt.io - @elmanu
GROUP MEMBERSHIP WITH A SINGLE
GROUP IS IMPOSSIBLE WHEN THERE ARE
NODES THAT ARE SUSPECTED OF
HAVING FAILED 3
3
Chandra et al: On the Impossibility of Group Membership (1996)
Webinar - https://manuel.bernhardt.io - @elmanu
IT WOULD BE UNWISE TO MAKE
MEMBERSHIP-RELATED DECISIONS
WHILE THERE ARE PROCESSES
SUSPECTED OF HAVING CRASHED
Webinar - https://manuel.bernhardt.io - @elmanu
"NETWORK PARTITIONS
DO NOT HAPPEN"
> "we have never observed a partition
in our network"
> "we have been running this
infrastructure for X months now and
nothing ever happened"
> "our network is reliable"
Webinar - https://manuel.bernhardt.io - @elmanu
NETWORK PARTITIONS
> more on https://aphyr.com/posts/288-the-network-
is-reliable
> it's not a matter of if, but when.
Webinar - https://manuel.bernhardt.io - @elmanu
IN AKKA CLUSTER, THE LEADER CANNOT
TAKE DECISIONS SO LONG AS THERE
ARE MEMBERS THAT ARE FLAGGED AS
UNREACHABLE BY THE FAILURE
DETECTOR
Webinar - https://manuel.bernhardt.io - @elmanu
Webinar - https://manuel.bernhardt.io - @elmanu
Webinar - https://manuel.bernhardt.io - @elmanu
Webinar - https://manuel.bernhardt.io - @elmanu
Webinar - https://manuel.bernhardt.io - @elmanu
Webinar - https://manuel.bernhardt.io - @elmanu
Webinar - https://manuel.bernhardt.io - @elmanu
IF YOU USE AUTO-DOWNING IN
PRODUCTION, YOU ARE GUARANTEED TO
GET A SPLIT-BRAIN SCENARIO AT SOME
POINT IN TIME
Webinar - https://manuel.bernhardt.io - @elmanu
USING AUTO-DOWNING IN AKKA 2.6
⠀
Webinar - https://manuel.bernhardt.io - @elmanu
USING AUTO-DOWNING IN AKKA 2.6
> you can't.
Webinar - https://manuel.bernhardt.io - @elmanu
USING AUTO-DOWNING IN AKKA 2.6
> you can't.
> it's gone.
Webinar - https://manuel.bernhardt.io - @elmanu
USING AUTO-DOWNING IN AKKA 2.6
> you can't.
> it's gone.
> use a proper split brain resolver / preventer
Webinar - https://manuel.bernhardt.io - @elmanu
SPLIT BRAIN RESOLVERS
> Akka Split Brain Resolver by Lightbend
> open-source implementations (at your own risk)
> roll your own (seriously, don't do that)
Webinar - https://manuel.bernhardt.io - @elmanu
ANTI-PATTERN #7BEING OUT OF TOUCH WITH THE HARDWARE
Webinar - https://manuel.bernhardt.io - @elmanu
Webinar - https://manuel.bernhardt.io - @elmanu
WHY IS THIS A BAD THING?
Webinar - https://manuel.bernhardt.io - @elmanu
AWS & VCPUS
Webinar - https://manuel.bernhardt.io - @elmanu
GCP & VCPUS
Webinar - https://manuel.bernhardt.io - @elmanu
EXAMPLE
> kubernetes deployment with 2 CPUs /
container
> default Akka configuration - 16
threads default EC + 16 threads for
the internal dispatcher
=> 32 threads contending for 1 real
core which itself may not be dedicated
Webinar - https://manuel.bernhardt.io - @elmanu
BEING OUT OF TOUCH WITH THE HARDWARE
IN AKKA 2.6
⠀
Webinar - https://manuel.bernhardt.io - @elmanu
BEING OUT OF TOUCH WITH THE HARDWARE
IN AKKA 2.6
> you absolutely can.
Webinar - https://manuel.bernhardt.io - @elmanu
BEING OUT OF TOUCH WITH THE HARDWARE
IN AKKA 2.6
> you absolutely can.
> Akka can do a lot, but it can't do magic
> learn the basics, know your infrastructure
Webinar - https://manuel.bernhardt.io - @elmanu
THANK YOU
> Questions, comments, feedback?
> Contact me at manuel@bernhardt.io /
@elmanu
> Read more about Akka at
https://manuel.bernhardt.io/
articles
Webinar - https://manuel.bernhardt.io - @elmanu

More Related Content

Similar to Akka Anti-Patterns, Goodbye: Six Features of Akka 2.6

Case study blocked queues
Case study blocked queuesCase study blocked queues
Case study blocked queueswalldorf_share
 
AMIMOTO WordPress + Amazon Web Services Hands-on
AMIMOTO WordPress + Amazon Web Services Hands-on AMIMOTO WordPress + Amazon Web Services Hands-on
AMIMOTO WordPress + Amazon Web Services Hands-on Kel
 
Implementing Web Services In Java
Implementing Web Services In JavaImplementing Web Services In Java
Implementing Web Services In JavaEdureka!
 
Queue blocked issue case study final edition
Queue blocked issue case study final editionQueue blocked issue case study final edition
Queue blocked issue case study final editionwalldorf_share
 
Debugging lightning components
Debugging lightning componentsDebugging lightning components
Debugging lightning componentsMadan Khichi
 
Debugging lightning components
Debugging lightning componentsDebugging lightning components
Debugging lightning componentsMohith Shrivastava
 
HTML Hypermedia APIs and Adaptive Web Design - jDays 2013
HTML Hypermedia APIs and Adaptive Web Design - jDays 2013HTML Hypermedia APIs and Adaptive Web Design - jDays 2013
HTML Hypermedia APIs and Adaptive Web Design - jDays 2013Gustaf Nilsson Kotte
 
Microservices: What's Missing - O'Reilly Software Architecture New York
Microservices: What's Missing - O'Reilly Software Architecture New YorkMicroservices: What's Missing - O'Reilly Software Architecture New York
Microservices: What's Missing - O'Reilly Software Architecture New YorkAdrian Cockcroft
 
Webinar - A Developer's Quick Start Guide to Open Source Process Automation U...
Webinar - A Developer's Quick Start Guide to Open Source Process Automation U...Webinar - A Developer's Quick Start Guide to Open Source Process Automation U...
Webinar - A Developer's Quick Start Guide to Open Source Process Automation U...camunda services GmbH
 
Salesforce Winter '20 release top picks!
Salesforce Winter '20 release top picks!Salesforce Winter '20 release top picks!
Salesforce Winter '20 release top picks!Sjoerd Woltjer
 
8 Akka anti-patterns you'd better be aware of
8 Akka anti-patterns you'd better be aware of8 Akka anti-patterns you'd better be aware of
8 Akka anti-patterns you'd better be aware ofManuel Bernhardt
 
10 Lessons Learned from using Kafka in 1000 microservices - ScalaUA
10 Lessons Learned from using Kafka in 1000 microservices - ScalaUA10 Lessons Learned from using Kafka in 1000 microservices - ScalaUA
10 Lessons Learned from using Kafka in 1000 microservices - ScalaUANatan Silnitsky
 
Stateful patterns in Azure Functions
Stateful patterns in Azure FunctionsStateful patterns in Azure Functions
Stateful patterns in Azure FunctionsMassimo Bonanni
 
Open Source workflow automation with BPMN 2.0, Java and camunda - Bernd Rücker
Open Source workflow automation with BPMN 2.0, Java and camunda - Bernd RückerOpen Source workflow automation with BPMN 2.0, Java and camunda - Bernd Rücker
Open Source workflow automation with BPMN 2.0, Java and camunda - Bernd RückerJAXLondon2014
 
Why we choose Symfony2
Why we choose Symfony2Why we choose Symfony2
Why we choose Symfony2Merixstudio
 
Android reverse engineering - Analyzing skype
Android reverse engineering - Analyzing skypeAndroid reverse engineering - Analyzing skype
Android reverse engineering - Analyzing skypeMário Almeida
 
Legacy Code: Evolve or Rewrite?
Legacy Code: Evolve or Rewrite?Legacy Code: Evolve or Rewrite?
Legacy Code: Evolve or Rewrite?Cyrille Martraire
 
Telco - Community Meetup - Automation.pdf
Telco - Community Meetup - Automation.pdfTelco - Community Meetup - Automation.pdf
Telco - Community Meetup - Automation.pdfAmir Khan
 
How to build 1000 microservices with Kafka and thrive
How to build 1000 microservices with Kafka and thriveHow to build 1000 microservices with Kafka and thrive
How to build 1000 microservices with Kafka and thriveNatan Silnitsky
 
High Interoperability with Magnolia's Open Suite Approach
High Interoperability with Magnolia's Open Suite ApproachHigh Interoperability with Magnolia's Open Suite Approach
High Interoperability with Magnolia's Open Suite ApproachMagnolia
 

Similar to Akka Anti-Patterns, Goodbye: Six Features of Akka 2.6 (20)

Case study blocked queues
Case study blocked queuesCase study blocked queues
Case study blocked queues
 
AMIMOTO WordPress + Amazon Web Services Hands-on
AMIMOTO WordPress + Amazon Web Services Hands-on AMIMOTO WordPress + Amazon Web Services Hands-on
AMIMOTO WordPress + Amazon Web Services Hands-on
 
Implementing Web Services In Java
Implementing Web Services In JavaImplementing Web Services In Java
Implementing Web Services In Java
 
Queue blocked issue case study final edition
Queue blocked issue case study final editionQueue blocked issue case study final edition
Queue blocked issue case study final edition
 
Debugging lightning components
Debugging lightning componentsDebugging lightning components
Debugging lightning components
 
Debugging lightning components
Debugging lightning componentsDebugging lightning components
Debugging lightning components
 
HTML Hypermedia APIs and Adaptive Web Design - jDays 2013
HTML Hypermedia APIs and Adaptive Web Design - jDays 2013HTML Hypermedia APIs and Adaptive Web Design - jDays 2013
HTML Hypermedia APIs and Adaptive Web Design - jDays 2013
 
Microservices: What's Missing - O'Reilly Software Architecture New York
Microservices: What's Missing - O'Reilly Software Architecture New YorkMicroservices: What's Missing - O'Reilly Software Architecture New York
Microservices: What's Missing - O'Reilly Software Architecture New York
 
Webinar - A Developer's Quick Start Guide to Open Source Process Automation U...
Webinar - A Developer's Quick Start Guide to Open Source Process Automation U...Webinar - A Developer's Quick Start Guide to Open Source Process Automation U...
Webinar - A Developer's Quick Start Guide to Open Source Process Automation U...
 
Salesforce Winter '20 release top picks!
Salesforce Winter '20 release top picks!Salesforce Winter '20 release top picks!
Salesforce Winter '20 release top picks!
 
8 Akka anti-patterns you'd better be aware of
8 Akka anti-patterns you'd better be aware of8 Akka anti-patterns you'd better be aware of
8 Akka anti-patterns you'd better be aware of
 
10 Lessons Learned from using Kafka in 1000 microservices - ScalaUA
10 Lessons Learned from using Kafka in 1000 microservices - ScalaUA10 Lessons Learned from using Kafka in 1000 microservices - ScalaUA
10 Lessons Learned from using Kafka in 1000 microservices - ScalaUA
 
Stateful patterns in Azure Functions
Stateful patterns in Azure FunctionsStateful patterns in Azure Functions
Stateful patterns in Azure Functions
 
Open Source workflow automation with BPMN 2.0, Java and camunda - Bernd Rücker
Open Source workflow automation with BPMN 2.0, Java and camunda - Bernd RückerOpen Source workflow automation with BPMN 2.0, Java and camunda - Bernd Rücker
Open Source workflow automation with BPMN 2.0, Java and camunda - Bernd Rücker
 
Why we choose Symfony2
Why we choose Symfony2Why we choose Symfony2
Why we choose Symfony2
 
Android reverse engineering - Analyzing skype
Android reverse engineering - Analyzing skypeAndroid reverse engineering - Analyzing skype
Android reverse engineering - Analyzing skype
 
Legacy Code: Evolve or Rewrite?
Legacy Code: Evolve or Rewrite?Legacy Code: Evolve or Rewrite?
Legacy Code: Evolve or Rewrite?
 
Telco - Community Meetup - Automation.pdf
Telco - Community Meetup - Automation.pdfTelco - Community Meetup - Automation.pdf
Telco - Community Meetup - Automation.pdf
 
How to build 1000 microservices with Kafka and thrive
How to build 1000 microservices with Kafka and thriveHow to build 1000 microservices with Kafka and thrive
How to build 1000 microservices with Kafka and thrive
 
High Interoperability with Magnolia's Open Suite Approach
High Interoperability with Magnolia's Open Suite ApproachHigh Interoperability with Magnolia's Open Suite Approach
High Interoperability with Magnolia's Open Suite Approach
 

More from Lightbend

IoT 'Megaservices' - High Throughput Microservices with Akka
IoT 'Megaservices' - High Throughput Microservices with AkkaIoT 'Megaservices' - High Throughput Microservices with Akka
IoT 'Megaservices' - High Throughput Microservices with AkkaLightbend
 
How Akka Cluster Works: Actors Living in a Cluster
How Akka Cluster Works: Actors Living in a ClusterHow Akka Cluster Works: Actors Living in a Cluster
How Akka Cluster Works: Actors Living in a ClusterLightbend
 
The Reactive Principles: Eight Tenets For Building Cloud Native Applications
The Reactive Principles: Eight Tenets For Building Cloud Native ApplicationsThe Reactive Principles: Eight Tenets For Building Cloud Native Applications
The Reactive Principles: Eight Tenets For Building Cloud Native ApplicationsLightbend
 
Putting the 'I' in IoT - Building Digital Twins with Akka Microservices
Putting the 'I' in IoT - Building Digital Twins with Akka MicroservicesPutting the 'I' in IoT - Building Digital Twins with Akka Microservices
Putting the 'I' in IoT - Building Digital Twins with Akka MicroservicesLightbend
 
Akka at Enterprise Scale: Performance Tuning Distributed Applications
Akka at Enterprise Scale: Performance Tuning Distributed ApplicationsAkka at Enterprise Scale: Performance Tuning Distributed Applications
Akka at Enterprise Scale: Performance Tuning Distributed ApplicationsLightbend
 
Digital Transformation with Kubernetes, Containers, and Microservices
Digital Transformation with Kubernetes, Containers, and MicroservicesDigital Transformation with Kubernetes, Containers, and Microservices
Digital Transformation with Kubernetes, Containers, and MicroservicesLightbend
 
Detecting Real-Time Financial Fraud with Cloudflow on Kubernetes
Detecting Real-Time Financial Fraud with Cloudflow on KubernetesDetecting Real-Time Financial Fraud with Cloudflow on Kubernetes
Detecting Real-Time Financial Fraud with Cloudflow on KubernetesLightbend
 
Cloudstate - Towards Stateful Serverless
Cloudstate - Towards Stateful ServerlessCloudstate - Towards Stateful Serverless
Cloudstate - Towards Stateful ServerlessLightbend
 
Digital Transformation from Monoliths to Microservices to Serverless and Beyond
Digital Transformation from Monoliths to Microservices to Serverless and BeyondDigital Transformation from Monoliths to Microservices to Serverless and Beyond
Digital Transformation from Monoliths to Microservices to Serverless and BeyondLightbend
 
Lessons From HPE: From Batch To Streaming For 20 Billion Sensors With Lightbe...
Lessons From HPE: From Batch To Streaming For 20 Billion Sensors With Lightbe...Lessons From HPE: From Batch To Streaming For 20 Billion Sensors With Lightbe...
Lessons From HPE: From Batch To Streaming For 20 Billion Sensors With Lightbe...Lightbend
 
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...Lightbend
 
Microservices, Kubernetes, and Application Modernization Done Right
Microservices, Kubernetes, and Application Modernization Done RightMicroservices, Kubernetes, and Application Modernization Done Right
Microservices, Kubernetes, and Application Modernization Done RightLightbend
 
Full Stack Reactive In Practice
Full Stack Reactive In PracticeFull Stack Reactive In Practice
Full Stack Reactive In PracticeLightbend
 
Akka and Kubernetes: A Symbiotic Love Story
Akka and Kubernetes: A Symbiotic Love StoryAkka and Kubernetes: A Symbiotic Love Story
Akka and Kubernetes: A Symbiotic Love StoryLightbend
 
Scala 3 Is Coming: Martin Odersky Shares What To Know
Scala 3 Is Coming: Martin Odersky Shares What To KnowScala 3 Is Coming: Martin Odersky Shares What To Know
Scala 3 Is Coming: Martin Odersky Shares What To KnowLightbend
 
Migrating From Java EE To Cloud-Native Reactive Systems
Migrating From Java EE To Cloud-Native Reactive SystemsMigrating From Java EE To Cloud-Native Reactive Systems
Migrating From Java EE To Cloud-Native Reactive SystemsLightbend
 
Running Kafka On Kubernetes With Strimzi For Real-Time Streaming Applications
Running Kafka On Kubernetes With Strimzi For Real-Time Streaming ApplicationsRunning Kafka On Kubernetes With Strimzi For Real-Time Streaming Applications
Running Kafka On Kubernetes With Strimzi For Real-Time Streaming ApplicationsLightbend
 
Designing Events-First Microservices For A Cloud Native World
Designing Events-First Microservices For A Cloud Native WorldDesigning Events-First Microservices For A Cloud Native World
Designing Events-First Microservices For A Cloud Native WorldLightbend
 
Scala Security: Eliminate 200+ Code-Level Threats With Fortify SCA For Scala
Scala Security: Eliminate 200+ Code-Level Threats With Fortify SCA For ScalaScala Security: Eliminate 200+ Code-Level Threats With Fortify SCA For Scala
Scala Security: Eliminate 200+ Code-Level Threats With Fortify SCA For ScalaLightbend
 
How To Build, Integrate, and Deploy Real-Time Streaming Pipelines On Kubernetes
How To Build, Integrate, and Deploy Real-Time Streaming Pipelines On KubernetesHow To Build, Integrate, and Deploy Real-Time Streaming Pipelines On Kubernetes
How To Build, Integrate, and Deploy Real-Time Streaming Pipelines On KubernetesLightbend
 

More from Lightbend (20)

IoT 'Megaservices' - High Throughput Microservices with Akka
IoT 'Megaservices' - High Throughput Microservices with AkkaIoT 'Megaservices' - High Throughput Microservices with Akka
IoT 'Megaservices' - High Throughput Microservices with Akka
 
How Akka Cluster Works: Actors Living in a Cluster
How Akka Cluster Works: Actors Living in a ClusterHow Akka Cluster Works: Actors Living in a Cluster
How Akka Cluster Works: Actors Living in a Cluster
 
The Reactive Principles: Eight Tenets For Building Cloud Native Applications
The Reactive Principles: Eight Tenets For Building Cloud Native ApplicationsThe Reactive Principles: Eight Tenets For Building Cloud Native Applications
The Reactive Principles: Eight Tenets For Building Cloud Native Applications
 
Putting the 'I' in IoT - Building Digital Twins with Akka Microservices
Putting the 'I' in IoT - Building Digital Twins with Akka MicroservicesPutting the 'I' in IoT - Building Digital Twins with Akka Microservices
Putting the 'I' in IoT - Building Digital Twins with Akka Microservices
 
Akka at Enterprise Scale: Performance Tuning Distributed Applications
Akka at Enterprise Scale: Performance Tuning Distributed ApplicationsAkka at Enterprise Scale: Performance Tuning Distributed Applications
Akka at Enterprise Scale: Performance Tuning Distributed Applications
 
Digital Transformation with Kubernetes, Containers, and Microservices
Digital Transformation with Kubernetes, Containers, and MicroservicesDigital Transformation with Kubernetes, Containers, and Microservices
Digital Transformation with Kubernetes, Containers, and Microservices
 
Detecting Real-Time Financial Fraud with Cloudflow on Kubernetes
Detecting Real-Time Financial Fraud with Cloudflow on KubernetesDetecting Real-Time Financial Fraud with Cloudflow on Kubernetes
Detecting Real-Time Financial Fraud with Cloudflow on Kubernetes
 
Cloudstate - Towards Stateful Serverless
Cloudstate - Towards Stateful ServerlessCloudstate - Towards Stateful Serverless
Cloudstate - Towards Stateful Serverless
 
Digital Transformation from Monoliths to Microservices to Serverless and Beyond
Digital Transformation from Monoliths to Microservices to Serverless and BeyondDigital Transformation from Monoliths to Microservices to Serverless and Beyond
Digital Transformation from Monoliths to Microservices to Serverless and Beyond
 
Lessons From HPE: From Batch To Streaming For 20 Billion Sensors With Lightbe...
Lessons From HPE: From Batch To Streaming For 20 Billion Sensors With Lightbe...Lessons From HPE: From Batch To Streaming For 20 Billion Sensors With Lightbe...
Lessons From HPE: From Batch To Streaming For 20 Billion Sensors With Lightbe...
 
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
 
Microservices, Kubernetes, and Application Modernization Done Right
Microservices, Kubernetes, and Application Modernization Done RightMicroservices, Kubernetes, and Application Modernization Done Right
Microservices, Kubernetes, and Application Modernization Done Right
 
Full Stack Reactive In Practice
Full Stack Reactive In PracticeFull Stack Reactive In Practice
Full Stack Reactive In Practice
 
Akka and Kubernetes: A Symbiotic Love Story
Akka and Kubernetes: A Symbiotic Love StoryAkka and Kubernetes: A Symbiotic Love Story
Akka and Kubernetes: A Symbiotic Love Story
 
Scala 3 Is Coming: Martin Odersky Shares What To Know
Scala 3 Is Coming: Martin Odersky Shares What To KnowScala 3 Is Coming: Martin Odersky Shares What To Know
Scala 3 Is Coming: Martin Odersky Shares What To Know
 
Migrating From Java EE To Cloud-Native Reactive Systems
Migrating From Java EE To Cloud-Native Reactive SystemsMigrating From Java EE To Cloud-Native Reactive Systems
Migrating From Java EE To Cloud-Native Reactive Systems
 
Running Kafka On Kubernetes With Strimzi For Real-Time Streaming Applications
Running Kafka On Kubernetes With Strimzi For Real-Time Streaming ApplicationsRunning Kafka On Kubernetes With Strimzi For Real-Time Streaming Applications
Running Kafka On Kubernetes With Strimzi For Real-Time Streaming Applications
 
Designing Events-First Microservices For A Cloud Native World
Designing Events-First Microservices For A Cloud Native WorldDesigning Events-First Microservices For A Cloud Native World
Designing Events-First Microservices For A Cloud Native World
 
Scala Security: Eliminate 200+ Code-Level Threats With Fortify SCA For Scala
Scala Security: Eliminate 200+ Code-Level Threats With Fortify SCA For ScalaScala Security: Eliminate 200+ Code-Level Threats With Fortify SCA For Scala
Scala Security: Eliminate 200+ Code-Level Threats With Fortify SCA For Scala
 
How To Build, Integrate, and Deploy Real-Time Streaming Pipelines On Kubernetes
How To Build, Integrate, and Deploy Real-Time Streaming Pipelines On KubernetesHow To Build, Integrate, and Deploy Real-Time Streaming Pipelines On Kubernetes
How To Build, Integrate, and Deploy Real-Time Streaming Pipelines On Kubernetes
 

Recently uploaded

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 

Recently uploaded (20)

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 

Akka Anti-Patterns, Goodbye: Six Features of Akka 2.6

  • 1. AKKA ANTI-PATTERNS, GOODBYE: SIX FEATURES OF AKKA 2.6 WEBINAR MANUEL BERNHARDT
  • 4. WHY? > collected recuring "worst practices" over the years 1 > ranges from beginner mistakes to design issues that can affect a project over years > most of it has been adressed in Akka 2.6! Let's have a look at 6 of them 1 https://manuel.bernhardt.io/akka-anti-patterns Webinar - https://manuel.bernhardt.io - @elmanu
  • 5. MANUEL.BERNHARDT.IO > Helping companies to get started with reactive systems... > ... or to solve critical production issues > Lightbend consulting and training partner Webinar - https://manuel.bernhardt.io - @elmanu
  • 6. MANUEL.BERNHARDT.IO > Helping companies to get started with reactive systems... > ... or to solve critical production issues > Lightbend consulting and training partner Webinar - https://manuel.bernhardt.io - @elmanu
  • 7. AKKA 2.6 > previous major release (2.5.0) in April 2017 > introduces Akka Typed API, but does not deprecate the Classic one > Artery as default transport > many, many improvements and fixes Webinar - https://manuel.bernhardt.io - @elmanu
  • 9. If you fail to plan, you are planning to fail! — Benjamin Franklin Webinar - https://manuel.bernhardt.io - @elmanu
  • 10. ANTI-PATTERN #1 NOT DEFINING A PROTOCOL Webinar - https://manuel.bernhardt.io - @elmanu
  • 11. > quite often, actor systems are built without giving much thought to the message protocol itself > this works quite well in the beginning, but can become quite a burden in the long run Webinar - https://manuel.bernhardt.io - @elmanu
  • 12. HOW THINGS MAY GO WRONG > tight coupling: message re-use that makes it harder to evolve over time > responsibilities: responsibilities that belong together may be split accross actors over time > inefficiencies: "organic" growth of an actor system makes it easy to loose track of how information is exchanged, can lead to unnecessary message exchanges Webinar - https://manuel.bernhardt.io - @elmanu
  • 13. It is really difficult to evolve protocols in the classic API due its dynamic nature / very open definition Webinar - https://manuel.bernhardt.io - @elmanu
  • 14. "NOT DEFINING A PROTOCOL" IN AKKA 2.6 / TYPED ⠀ Webinar - https://manuel.bernhardt.io - @elmanu
  • 15. "NOT DEFINING A PROTOCOL" IN AKKA 2.6 / TYPED > you can't. Webinar - https://manuel.bernhardt.io - @elmanu
  • 16. "NOT DEFINING A PROTOCOL" IN AKKA 2.6 / TYPED > you can't. > Akka Typed forces you to define a protocol > you need to specify: > what type of message an actor can handle > what type of response a message expects Webinar - https://manuel.bernhardt.io - @elmanu
  • 17. TYPE OF MESSAGE AN ACTOR CAN HANDLE // marker of the message protocol sealed trait ConfigurationCommand // actor supporting this protocol class Configuration( context: ActorContext[ConfigurationCommand] ) extends AbstractBehavior[ConfigurationCommand] { ... } Webinar - https://manuel.bernhardt.io - @elmanu
  • 18. TYPE OF MESSAGE AN ACTOR EXPECTS (1) // a message of the Configuration protocol final case class RetrieveConfiguration( merchantId: MerchantId, replyTo: ActorRef[ConfigurationResponse] ) extends ConfigurationCommand Webinar - https://manuel.bernhardt.io - @elmanu
  • 19. TYPE OF MESSAGE AN ACTOR EXPECTS (2) sealed trait ConfigurationResponse final case class ConfigurationFound( configuration: MerchantConfiguration ) extends ConfigurationResponse Webinar - https://manuel.bernhardt.io - @elmanu
  • 20. HOW DOES THIS CHANGE THE GAME? > the beginner mistake of sending messages to the wrong actor can no longer happen > message paths are now checked by the compiler > you can infer the protocol flow from the ActorRef[Message] included in the messages Webinar - https://manuel.bernhardt.io - @elmanu
  • 21. sealed trait BankingCommand final case class Login( credentials: Credentials, replyTo: ActorRef[LoginResponse] ) extends BankingCommand sealed trait LoginResponse final case class Authenticated( session: ActorRef[SessionCommand] ) extends LoginResponse sealed trait SessionCommand final case class CreateTransaction( transaction: Transaction ) extends SessionCommand Webinar - https://manuel.bernhardt.io - @elmanu
  • 23. Time is a storm in which we are all lost. — William Carlos Williams Webinar - https://manuel.bernhardt.io - @elmanu
  • 24. ANTI-PATTERN #2 RACE CONDITIONS Webinar - https://manuel.bernhardt.io - @elmanu
  • 25. > in the actor model, actors handle messages one after another > it is safe to use mutable state inside of an actor > unless you do the following Webinar - https://manuel.bernhardt.io - @elmanu
  • 26. CLASSIC API class TransactionManager(processor: ActorRef) extends Actor { var transactions = List.empty[Transaction] def receive: Receive = { case ProcessTransaction(transactionRequest) => val response: Future[ProcessingResponse] = processor ? Process(transactionRequest) response.map { // here be dragons! transactions = response.transaction :: transactions } } } Webinar - https://manuel.bernhardt.io - @elmanu
  • 27. WHAT'S THE PROBLEM? > using asynchronous constructs inside of the actor (single-threaded illusion) is error-prone > quite easy to make mistakes of this kind (I've seen it many, many times) > the recommended way is to use ask in combination with the pipe pattern, but people may forget / not know Webinar - https://manuel.bernhardt.io - @elmanu
  • 28. "MISUSING ASK / FUTURES" IN AKKA 2.6 / TYPED ⠀ Webinar - https://manuel.bernhardt.io - @elmanu
  • 29. "MISUSING ASK / FUTURES" IN AKKA 2.6 / TYPED > you can't. Webinar - https://manuel.bernhardt.io - @elmanu
  • 30. class TransactionManager( processor: ActorRef[ProcessorCommand] ) extends AbstractBehavior[ManagerCommand] { var transactions = List.empty[Transaction] def receive: Receive = { case ProcessTransaction(transactionRequest) => context.ask(processor, Process(transactionRequest)) { case Success(ProcessingResponse(transaction)) => AddTransaction(transaction) case Failure(_) => TransactionFailed(transactionRequest) } case AddTransaction(transaction) => transactions = response.transaction :: transactions case TransactionFailed(request) => // ... } } Webinar - https://manuel.bernhardt.io - @elmanu
  • 32. "...some men aren't looking for anything logical, like money. They can't be bought, bullied, reasoned, or negotiated with. Some men just want to watch the world burn." — Alfred Pennyworth, Batman, The Dark Knight Webinar - https://manuel.bernhardt.io - @elmanu
  • 33. ANTI-PATTERN #3 BLOCKINGWebinar - https://manuel.bernhardt.io - @elmanu
  • 34. HOW CAN THIS HAPPEN? > calling a synchronous API > or calling an API that calls an API that calls an API... that calls a synchronous API > explicitly waiting for the completion of a Future (Await.result) Webinar - https://manuel.bernhardt.io - @elmanu
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42. BRINGING DOWN AKKA 2.6 BY BLOCKING ⠀ Webinar - https://manuel.bernhardt.io - @elmanu
  • 43. BRINGING DOWN AKKA 2.6 BY BLOCKING > you can't. Webinar - https://manuel.bernhardt.io - @elmanu
  • 44. BRINGING DOWN AKKA 2.6 BY BLOCKING > you can't. > new internal dispatcher for all of Akka's internal actors > you can still starve your own actors, but Akka's internal mechanisms will continue working Webinar - https://manuel.bernhardt.io - @elmanu
  • 45. IF YOU REALLY NEED TO BLOCK blocking-io-dispatcher { type = Dispatcher executor = "thread-pool-executor" thread-pool-executor { fixed-pool-size = 8 } throughput = 1 } Webinar - https://manuel.bernhardt.io - @elmanu
  • 46. IF YOU REALLY NEED TO BLOCK context.spawn( blockingBehavior, "blocking-actor", DispatcherSelector.fromConfig( "blocking-io-dispatcher" ) ) Webinar - https://manuel.bernhardt.io - @elmanu
  • 48. This is the way the world ends Not with a bang but a whimper. — T.S. Eliot Webinar - https://manuel.bernhardt.io - @elmanu
  • 49. ANTI-PATTERN #4 USING JAVA SERIALIZATION Webinar - https://manuel.bernhardt.io - @elmanu
  • 50. HOW COULD THIS HAPPEN? > leaving the default on > ignoring the nagging warning messages in the logs > affects both serialization of messages over the wire and for persistence Webinar - https://manuel.bernhardt.io - @elmanu
  • 51. WHY IS IT BAD? > performance penalty! > poor candidate for protocol evolution - message evolutions result in older components not able to process them any longer > persistance - messages and snapshots can't be processed any longer after changes > poor security Webinar - https://manuel.bernhardt.io - @elmanu
  • 52. USING JAVA SERIALIZATION IN AKKA 2.6 ⠀ Webinar - https://manuel.bernhardt.io - @elmanu
  • 53. USING JAVA SERIALIZATION IN AKKA 2.6 > you can't. Webinar - https://manuel.bernhardt.io - @elmanu
  • 54. USING JAVA SERIALIZATION IN AKKA 2.6 > you can't. > ... or at least not by default > Jackson is the new default, with a decently performing binary serialization format (CBOR), should be good in most cases Webinar - https://manuel.bernhardt.io - @elmanu
  • 55. USING JACKSON SERIALIZATION /** marker interface **/ public interface CborSerializable {} class Message implements CborSerializable { public final String id; public Message(String id) { this.id = id; } } Webinar - https://manuel.bernhardt.io - @elmanu
  • 56. USING JACKSON SERIALIZATION akka.actor { serialization-bindings { "com.example.CborSerializable" = jackson-cbor } } Webinar - https://manuel.bernhardt.io - @elmanu
  • 57. JACKSON VS. PROTOCOL BUFFERS > protobuf as a very popular binary serialization in Akka projects in the past > it turns out that Jackson is a very decent alternative and involves much less work than protobuf - also in terms of evolutions > definitely worth checking it out in detail before falling back to protobuf Webinar - https://manuel.bernhardt.io - @elmanu
  • 59. The desire of excessive power caused the angels to fall — Francis Bacon Webinar - https://manuel.bernhardt.io - @elmanu
  • 60. ANTI-PATTERN #5 USING AKKA REMOTING** DIRECTLY Webinar - https://manuel.bernhardt.io - @elmanu
  • 61.
  • 62.
  • 63.
  • 64. WHAT'S THE PROBLEM? > Akka Remoting allows to build pair-to-pair connections between nodes / Actor Systems > there's a lot more things to do when it comes to building stable applications on top of the network > not trivial Webinar - https://manuel.bernhardt.io - @elmanu
  • 66. DIRECTLY USING AKKA REMOTING IN AKKA 2.6 ⠀ Webinar - https://manuel.bernhardt.io - @elmanu
  • 67. DIRECTLY USING AKKA REMOTING IN AKKA 2.6 > you can't. Webinar - https://manuel.bernhardt.io - @elmanu
  • 68. DIRECTLY USING AKKA REMOTING IN AKKA 2.6 > you can't. > remote watch and deployment will only work when using the Cluster extension Webinar - https://manuel.bernhardt.io - @elmanu
  • 69. AKKA CLUSTER > membership service > primitives for building distributed systems: membership, singleton, sharding, CRDTs, etc. > check out the articles series2 about it 2 https://manuel.bernhardt.io/articles/#akka-cluster Webinar - https://manuel.bernhardt.io - @elmanu
  • 71. There are two ways to be fooled. One is to believe what isn't true; the other is to refuse to believe what is true. — Soren Kierkegaard Webinar - https://manuel.bernhardt.io - @elmanu
  • 72. ANTI-PATTERN #6 USING AUTO-DOWNING Webinar - https://manuel.bernhardt.io - @elmanu
  • 73. GROUP MEMBERSHIP WITH A SINGLE GROUP IS IMPOSSIBLE WHEN THERE ARE NODES THAT ARE SUSPECTED OF HAVING FAILED 3 3 Chandra et al: On the Impossibility of Group Membership (1996) Webinar - https://manuel.bernhardt.io - @elmanu
  • 74. IT WOULD BE UNWISE TO MAKE MEMBERSHIP-RELATED DECISIONS WHILE THERE ARE PROCESSES SUSPECTED OF HAVING CRASHED Webinar - https://manuel.bernhardt.io - @elmanu
  • 75. "NETWORK PARTITIONS DO NOT HAPPEN" > "we have never observed a partition in our network" > "we have been running this infrastructure for X months now and nothing ever happened" > "our network is reliable" Webinar - https://manuel.bernhardt.io - @elmanu
  • 76.
  • 77.
  • 78.
  • 79. NETWORK PARTITIONS > more on https://aphyr.com/posts/288-the-network- is-reliable > it's not a matter of if, but when. Webinar - https://manuel.bernhardt.io - @elmanu
  • 80. IN AKKA CLUSTER, THE LEADER CANNOT TAKE DECISIONS SO LONG AS THERE ARE MEMBERS THAT ARE FLAGGED AS UNREACHABLE BY THE FAILURE DETECTOR Webinar - https://manuel.bernhardt.io - @elmanu
  • 87. IF YOU USE AUTO-DOWNING IN PRODUCTION, YOU ARE GUARANTEED TO GET A SPLIT-BRAIN SCENARIO AT SOME POINT IN TIME Webinar - https://manuel.bernhardt.io - @elmanu
  • 88. USING AUTO-DOWNING IN AKKA 2.6 ⠀ Webinar - https://manuel.bernhardt.io - @elmanu
  • 89. USING AUTO-DOWNING IN AKKA 2.6 > you can't. Webinar - https://manuel.bernhardt.io - @elmanu
  • 90. USING AUTO-DOWNING IN AKKA 2.6 > you can't. > it's gone. Webinar - https://manuel.bernhardt.io - @elmanu
  • 91. USING AUTO-DOWNING IN AKKA 2.6 > you can't. > it's gone. > use a proper split brain resolver / preventer Webinar - https://manuel.bernhardt.io - @elmanu
  • 92. SPLIT BRAIN RESOLVERS > Akka Split Brain Resolver by Lightbend > open-source implementations (at your own risk) > roll your own (seriously, don't do that) Webinar - https://manuel.bernhardt.io - @elmanu
  • 93. ANTI-PATTERN #7BEING OUT OF TOUCH WITH THE HARDWARE Webinar - https://manuel.bernhardt.io - @elmanu
  • 95. WHY IS THIS A BAD THING? Webinar - https://manuel.bernhardt.io - @elmanu
  • 96.
  • 97.
  • 98. AWS & VCPUS Webinar - https://manuel.bernhardt.io - @elmanu
  • 99. GCP & VCPUS Webinar - https://manuel.bernhardt.io - @elmanu
  • 100.
  • 101.
  • 102.
  • 103.
  • 104.
  • 105.
  • 106. EXAMPLE > kubernetes deployment with 2 CPUs / container > default Akka configuration - 16 threads default EC + 16 threads for the internal dispatcher => 32 threads contending for 1 real core which itself may not be dedicated Webinar - https://manuel.bernhardt.io - @elmanu
  • 107. BEING OUT OF TOUCH WITH THE HARDWARE IN AKKA 2.6 ⠀ Webinar - https://manuel.bernhardt.io - @elmanu
  • 108. BEING OUT OF TOUCH WITH THE HARDWARE IN AKKA 2.6 > you absolutely can. Webinar - https://manuel.bernhardt.io - @elmanu
  • 109. BEING OUT OF TOUCH WITH THE HARDWARE IN AKKA 2.6 > you absolutely can. > Akka can do a lot, but it can't do magic > learn the basics, know your infrastructure Webinar - https://manuel.bernhardt.io - @elmanu
  • 110. THANK YOU > Questions, comments, feedback? > Contact me at manuel@bernhardt.io / @elmanu > Read more about Akka at https://manuel.bernhardt.io/ articles Webinar - https://manuel.bernhardt.io - @elmanu