Past and future events #2442
Replies: 2 comments
-
I've done some research for what are the solutions for handling events in time, be it in the past or in the future, and how is it done across different solutions. In Event Store context, I think Greg Young prelection about consistency give some insights to that. In Postgres space I've seen some research done about Bi-Temporal tables. For Events, you need to better describe what the event is. Sometimes what you're modeling is not Event that just happened, but additionally an Event of "Noticed that Event happened in the past" or "Assume that Event will happen in the future". In this situation you have Event Added Date (event_dt in this case) and Event In Effect Date. I don't believe that any Event Store should simplify this concept to just override Event Added Date to be used as Event In Effect Date. |
Beta Was this translation helpful? Give feedback.
-
This discussion might shed some light on time on domain modeling: https://youtu.be/xABtweT7Jzk?t=1274 |
Beta Was this translation helpful? Give feedback.
-
Hi, I am wondering if I can use Marten Event to store according this use case:
Basically I need to ability to add events in time point that is in past or future.
So when a field is updated I need to tell when this change is going to be established. As I see now
event_dt
table hastimestamp
column that tells when operation was triggered. I can modify this field to suit this scenario byinheriting from
DocumentSessionListenerBase
and overrdingBeforeSaveChangesAsync
so it could changetimestamp
data to the value that in Header (I would add new date value bofore that). But still I need a column that tells when this change actually was made and I don't see if it is possible to extend this table in Marten.It looks like the scenario for handling future events it's not the right fit and I have to make customized event sourcing. Also I see another issue - read model can be invalid because there will be pending events in the future that means I need to update read model every day using job to apply future events to read model .
Beta Was this translation helpful? Give feedback.
All reactions