One of the first steps is to create a virtual twin for an event stream. It would hold the content of the stream (persisted) and the new events. The question is on which level to abstract it. It opens a world of possibilities if it's an IO-bound stream that can reach the underlying store anytime. For example, the "domain model" can ask for the last event of a particular type without the need to read everything. So, it becomes similar to lazy IO. Such an abstraction would need access to the underlying store so that it would replace the AggregateStore or repository in many cases.
However, it would bring async ops and IO to the domain, for better or for worse.
Just putting my thoughts here for nurturing.
I plan to make aggregates optional.
One of the first steps is to create a virtual twin for an event stream. It would hold the content of the stream (persisted) and the new events. The question is on which level to abstract it. It opens a world of possibilities if it's an IO-bound stream that can reach the underlying store anytime. For example, the "domain model" can ask for the last event of a particular type without the need to read everything. So, it becomes similar to lazy IO. Such an abstraction would need access to the underlying store so that it would replace the AggregateStore or repository in many cases.
However, it would bring async ops and IO to the domain, for better or for worse.
Has anyone done something like this?