I am at the point where I have designed my simple Aggregate. I have some commands passed through a command gateway and I have an EventSourceRepository saving an XML serialisation of the events to a table called DomainEventEntry. I’ve got some other events subscribed which can save current state of the aggregate / domain objects to some object / relational tables. It’s looking good and the framework has given me a great leg up to get quickly to this point.
I’m going to have a look at the snapshoting functionality but I’d like to know whether there are any built-ins in the framework which can do event replay/ rewind / event audit for me. For example
knowing the identity of an object, replay from version 0 and provide a version of the aggregare with its state the way it was on a specified date, or up to a defined version. Additionally, provide an audit trail showing the changes at each revision.
for all objects, give me an aggregate which represents its state at a specified date
To satisfy the first bullet, everything is there in the DomainEventEntry table but it feels like an audit trail for a known object would be a common requirement across any usage of event sourcing. Is there such a thing in AXON ? Lookling at the implementation I have, the full aggregate is serialised as XML in the payload field of DomainEventEntry. Is there a way with Axon to make it just store the changes / deltas ?
For the second bullet, I can see that I could probably write something which generates state from the event log and stores that in a separate table. Maybe I can do this with snapshots ?