cloudstate
cloudstate copied to clipboard
Investigate using Akka Journal SPI
We can't use akka persistence typed in the Cloudstate proxy:
- Commands are handled asynchronously (ie, they go through Akka gRPC to the user function) but akka persistence typed requires you to immediately return the persistence effect
- Akka persistence typed lifts the state into its API, so it passes state around etc, but our proxies don't know what the state is, that's held in the user function and only passed to the proxy when the user function wants to snapshot
- So, either, we'll continue to use Akka classic typed, or maybe better, we won't use either, and instead use the Akka journal SPI directly - this might actually be simpler, and for example, means we can stream the event log recovery into the user function with back pressure (currently not possible).
(btw, this isn't a criticism of akka persistence typed, i think it's doing the right thing here, it's just that the API it provides is too high level for what we need in Cloudstate)
Robert Walker: @james So using a Akka journal plugin instead of classic, can you see any drawbacks?
Viktor Klang: I’m interested in the idea of using the Journal SPI
James Roper: the drawbacks would probably be that it might be too low level, we may end up implementing a lot of logic that wouldn't have to be done building on akka classic persistence... i think a spike would be the quickest way to find out what the drawbacks are
(This is that Spike) :-)