I was checking out the project chronicle-engine and the use case with the algotrading...
And there's something i'm not sure how to do with such
architecture.
As i understand from diagram all the current orderbooks for the markets that the system deals with are stored in a single persisted chronicle-map (and is updated by different process)...
Now suppose an update triggered a calculation of a Strategy.
Strategy runs, it reads the orderbook to see if there are any opportunities, now how do we guarantee that while this strategy reads the orderbook it is not being changed concurrently? (i understand that strategy may run for few microseconds but still its possible to have corrupted state right?)
In my current system I get streams of orderbook events, and i batch them, I apply a batch, run all the bots then repeat forever... (lmax disrupter under the hood)
In this case i can never have state of the orderbook changed while i'm executing a strategy... even if some event happened it wont be applied and i will determine that calculation was outdated later.
I understand this is not really a question about engine but i cant really picture any easy way trough this... Any advise appreciated.