Search code examples
javaakkaevent-sourcingakka-persistence

How to let akka event sourcing (akka-persistence) use parallel journal actors


I am testing event sourcing (akka-persistence) and wrote my own Journal plugin. But when running performance tests, I quickly noticed that not all CPU resources are used. The class which writes messages to the journal is an actor (e.g. is executes all write operations in serial).

Is it possible to use multiple instances of this journal actor to increase the write performance to the journal backend? If yes, how?

Thanks


Solution

  • As I hinted at on the akka-user mailing list, there is no way right now to have multiple Journal actors. What you can do though is to implement the AsyncWritePlugin API that will allow the actor to do the writes in a non blocking fashion, and then you can scale out the writes in your plugin.