architecture - CQRS and calculations -
i working on proof-of-concept code follows cqrs pattern , cannot find satisfactory solution problem [think i] have.
the system calculates impact of market changes against given portfolio based on specific scenarios.
portfolios can contain 1 several hundreds of holdings , market scenarios pre-defined or defined on fly user specific request.
in simplest form solution problem service returns values given input, in cqrs case seems me part performs calculation (domain) should not called part returns data (query).
considering system such have several portfolios , number of scenarios can quite high, don't think make sense store results of calculations.
anyone has solution issue or can point me in direction of article solves problem similar one?
cqrs not should pre-calculate in write side. when state of system changes through command, events created , projections listen these events , create model can used querying. model looks , used you. create projection of complete 3rd normal form database representation of system if want to.
if more practical these calculations on read side see no problem doing that, long ok lose result of calculations.
Comments
Post a Comment