Trying to plunge into CQRS (and DDD in general), I came across situations when two events occur in different aggregates, but their order matters domain. If so, then they can happen so close to each other that the timestamp (as used by the sample implementations I saw) cannot distinguish them, that is, the event store does not contain a “complete” representation of the domain, since there is ambiguity over the order in which events have occurred.
As an example, a domain can trigger CustomerCreatedEventthat applies to an aggregate Customer, and then a CustomerAssignedToAgentevent in the aggregate Agent. An event CustomerAssignedToAgentdoes not make sense if it occurs before CustomerCreatedEvent, but usually both of them can be triggered as a result of one operation, which makes it possible that the timestamps will be practically the same.
So am I just poorly modeling the situation? Should there be a situation where the sequence of events in different aggregates is important? Or should you store the global sequence number in the event store so you can determine the exact sequence in which the events occurred?
source
share