Is it possible to use Akka Persistence without a Cluster? Our desired architecture is to have a system where nodes receive Commands via Kafka (thus accomplishing sharding), but the only way of finding Actors that I see in the docs is by using ClusterSharding. There would be thousands of Actor/Behavior instances running as FSMs with unique IDs (so any given Command can only be processed by a particular Actor/Behavior). The general design would be:
KafkaConsumer (partition A) has a Guardian Actor ref that can route Commands to the relevant Persisted EventSourcedBehavior
If the Actor has been passivated, or if there is a redeploy, the Persisted EventSourcedBehavior is rehydrated to its latest state.
Possible solutions I’m considering are:
- Guardian actor maintains a hashmap of ID/EventSourcedBehavior ActorRef
- Using Cluster but each node is its own cluster (single node clusters)
I am unclear whether Option 1 would enable recovery correctly
Option 2 seems like it would ensure correct recovery, but seems like quite a hack and not even sure it would work. Also seems like bringing in a lot of dependencies that shouldn’t be needed.
Any guidance would be much appreciated.
Also, just to be clear, we are trying to avoid using Cluster Sharding as it seems to add a level of complexity that should not be needed and almost certainly won’t be approved.
Thanks
1 post - 1 participant