to .NET. I’ve seen a fair share of ”actor all the things” abuse since. I have an interest in IT strategy; Trade-offs, exit strategy, adoption, direction of the industry How can we build distributed systems without the framework lock-in?
all of the major Actor Model frameworks and languages have their own specific homegrown protocols Erlang OTP, Akka, Akka.NET, MsOrleans, none of them can talk to eachother using their own cluster protocols. Network Homegrown, non standard, framework specific protocol (OTP is a special case)
your current platform? What if the framework is no longer maintained, or there is a top level decision to move to another platform? Total cost of ownership, what is the cost of re-writing most or all of it?
State needs to move around when nodes fail. Everyone need to agree on what node owns the state. The more state you have, the heavier it is to move around. High consistency Easier Harder Concurrency control High availability Easier Harder High Availability
Framework e.g. Akka, Microsoft Orleans, OTP Middleware e.g. Kafka, Consul, Rabbit etc. Elasticity and concurrency should it be handled here? Here? Service A Service B Or here? Or maybe here?
if we instead shrink the responsibility of the cluster? Instead of encapsulating everything, including business logic, we can limit the scope to data transport and cluster semantics only.
consumer The cluster mechanism is separated from the components. The Components only need to agree on the protocols and contracts of the cluster, or use a prebuilt tool for this purpose, e.g. Apache Kafka, RabbitMQ, Consul etc.
We start out by having a higher number of partitions than consumers. partition partition partition consumer partition partition partition partition partition partition consumer consumer
worker4 consumer partition partition worker2 consumer partition partition worker3 consumer Elasticity by partitions Once a consumer is added, the partitions are rebalanced across the avaiable consumers. This allows consumers to scale up to the same number as the avaiable partitions. Sticky partitons coming to Kafka in v 0.11.0.0
partition partition worker3 consumer Partition to State affinity By partitioning events based on some form of unique identifier, e.g. CustomerId, Region or similar, we can make sure all events that belong together end up on the same partition. Once the events are assigned to a specific partition, it’s easy to build a stateful system behind the worker consuming this partition. Stateful worker2 source producer partition partition consumer
partition partition worker3 consumer Stateful worker2 source producer partition partition consumer Partition to State affinity This is conceptually similar to Akka Cluster Sharding and MsOrleans in the sense that developers do not need to care where objects are placed.
Framework e.g. Akka, Microsoft Orleans, OTP Middleware e.g. Kafka, Consul, Rabbit etc. Service Discovery and cluster membership should it be here? Here? Service A Service B Or here? Or maybe here?
Framework e.g. Akka, Microsoft Orleans, OTP Middleware e.g. Kafka, Consul, Rabbit etc. Cluster Management should it be here? Here? Service A Service B Or here? Or maybe here?
Framework e.g. Akka, Microsoft Orleans, OTP Middleware e.g. Kafka, Consul, Rabbit etc. Retry mechanisms? Here? Here? Service A Service B Or here? Or maybe here?
HTTP/2 Streams, Consul • Platform independent – C#, Go, Python, Javascript, Kotlin • Actors and Virtual Actors – Akka, Microsoft Orleans • Ultra fast – 65 times faster than Akka.NET over network Proto.Actor