We have multiple Event Type for a given Category and we have multiple streams per category record i.e. category-id would be the stream name… e.g. Customer-1234 would be the stream and would have multiple events viz CustomerCreated, CustomerUpdated, CustomerAddressUpdated, CustomerDOBUpdated etc within stream
We are using persistent subscriber to read the events and build the view models in MongoDB… When we delete our View Model (Mongo Collection) we always have to play all the events from the event store - we feel its too many events processing by the subscriber to generate the current state of an aggregate in order to render view model e.g. AddressCreated - AddressUpdated - AddressUpdated - AddressUpdated… At the end only the final address updated would be represented in the View Model… I dont think we could use $tb, $maxCount or $maxAge because we would need the original Created Event but instead of later 3 Updated event we just need the last one
How do we create rolling snapshot with a state aggregate from prior events? I was thinking may-be by using snapshot technique we could merge events to represent a state?
Not sure if I am off track… Thanks