Hi all,
I was wondering about the following and would love some input.
We have mutilple different stream types and some stream get accessed a lot more than other and in some cases we need a lot of performance on them.
So the scenario is as follows, we have a stream called finance-guid and this contains some information of a clients financial information. We have a stream per client, when modeling some future data on this stream a lot of reads and appends happen. We follow the pattern of snapshotting these streams per 500 events, this gives us almost all the perf we need.
Generally what happens in our world is that external systems would trigger the modeling part and the following happens, in our domain we have a couple of methods that would add or modify specific areas of the object, ones these are petfomed we call a calculate method and then this is returned.
So we load the stream from ES, either partially if we have a snapshot or not, then we perform some operations, perform the calculation and then persist again.
The area of issue is that in most cases the happens quite a lot in a short space of time, and getting the aggregate and saving is causing some performance to be degraded.
We can scale most parts of our APIs but we do want to think about costs as well.
Anyhow I am pondering the idea of using virtual Actors, so for instance if a client is now going to start modeling, what we would do is get the aggregate from the snapshot and the rest of the events from ES, and load that into a actor, the operations would happen on it and once the actor is deactivated we would get the new events to apply from it before deactivating and then persist to ES.
I believe this approach would work as the framework we are using for actors guarantees reliability as well as durability and also only having one instance of said actor available?
What do you guys think?
We would definitely have the perf that we require as it would be in memory, we would not need to rehydrate our aggregates the whole time and lastly we would still be persisting events to ES, but only after deactivation instead of after each modification.