Axon Snapshot Implementation

Hello all,

I just recently implemented Snapshots in a project. I however noticed the way axon stores snapshots is that it overwrites the previous snapshot value with a new one each time the trigger value is met.

Is there an implementation of snapshots where a new snapshot is inserted each time, rather than a previous one being updated? Then a replay of snapshots done.

I am querying the event store, and I need to be able to filter based on dates. But it becomes impossible if I have just a single snapshot value.

(NB: I choose to query the event store in a particular scenario on my system because updates to the read side causes performance issues)

I will appreciate help on this

Thanks

Hi Diane,

there appears to be another related to the snapshots being deleted, so there is a change coming up in how snapshots are stored. This is expected to be part of the next release.

For now, if you want to prevent snapshots to be deleted, you can create a subclass of your EventStorageEngine implementations (JPA or JDBC) and override the “deleteSnapshots” method. You can leave the overridden method empty, as you don’t want it to do anything.

Do note that snapshots are designed to optimize loading of Aggregates (in your Command Model). Using them to optimize queries (as well) may cause undesired coupling of your command and query models.

Cheers,

Allard