asynkron / protoactor-go

Proto Actor - Ultra fast distributed actors for Go, C# and Java/Kotlin
http://proto.actor
Apache License 2.0
5.07k stars 523 forks source link

Improve Cluster: More controlled activation of virtual actors #169

Closed mhennings closed 2 years ago

mhennings commented 7 years ago

Current Implementation

The partition actor is responsible to know where one partition of gam actors is spawned and also handles its activation.

There is an additional cache implemented in pidCachePartitionActor

When the cluster member list changes the partition actor tries to handover the actors that are no longer in its responsibility to a new partition.

Weaknesses:

Possible Solutions

In the following I try to provide a collection of possible implementation direction. The goal is not to just implement one, but to discuss what is the best fitting approach.

Local Spawning

As a quick fix I tried out to spawn virtual actors directly on the node which partiton actor is responsible

I put this to test and this worked quite fine in a scenario with persistent, cassandra backed, actors, but it has two drawbacks:

So to make this available to others it would require a configurable strategy at least.

Activation Strategy Configuration

To further improve the activation behavior it would be possible to create a interface that provides different choosable activation strategies.

Benefits:

Drawbacks:

Configurable partition actor storage

When looking at orleans there seems to be a pluggable storage behind the lookup of remote actors. The option to persist the dictionary in an external store can be used to avoid lost state in case of unexpected losses in the cluster.

Benefits:

Drawbacks:

Interface in front of full partition actor behavior

Instead of specific configuration for activation strategy and dictionary a interface in front of the partition actor would allow to experiment with completely different behavior without breaking changes to current API users.

Staged Cluster Join

In this section I would see all different variants of reaching such consensus. We could be looking either in direction of akka or orleans.

rogeralsing commented 2 years ago

This is now outdated. this is handled in the new architecture we are porting over right now. closing