MerrionComputing / EventsSourcing-on-Azure-Functions

A library to demonstrate doing Event Sourcing as a data persistence mechanism for Azure Functions
MIT License
103 stars 20 forks source link

TimeStreams - event streams keyed by timestamp #53

Open MerrionComputing opened 3 years ago

MerrionComputing commented 3 years ago

Another possible evolution of the Eventstream would be a stream keyed by timestamp which allows add/edit/update/delete but only for future dated events.

This could keep very similar code to the existing event stream code and projections would be able to run over them too - but would use different classes/attributes and different notifications as they would have a different business meaning.

MerrionComputing commented 3 years ago

Would need to use a common time frame - and I think there is a minimum sensible granularity to be found too (maybe 1 second?)

MerrionComputing commented 2 years ago

Thoughts

It would be possible to insert retrospective events which means that any cached or snapshotted state impacted would need to be recalculated. It would be preferable if this did not require the application developer to do any extra code

Also would need some strategy as to what to do in the event of a collision. Maybe a .00 - .99 extension so that the events at the same time are processed in the order in which they are known about.

MerrionComputing commented 1 year ago

Will use the same type of attribute as for event streams but with a different attribute name to differentiate e.g. :

[TimeStream("Bank","Account", "A123456")]