Hi,
I’m using Event Store for our DDD/CQRS/ES architecture. Each aggregate is sourced from/to an event stream like {aggregate type}-{id}.
Since remodelling of the domain model could result in new aggregate boundaries (merging aggregates or splitting into multiple aggregates), this would break the 1:1 mapping between aggregates and streams.
What options do I have available?
Merged aggregateI could read from multiple streams, but doing so incrementally (streaming/batching the read) is a tough problem considering that I somehow have to retain the relative order between the streams as well. I can’t just read from $all because that will be very considering the billions of events we expect to have. A projection that links these streams would, as far as I understand it, only be eventually consistent…
Split aggregateEach aggregate could read from the shared stream and only use the events that apply to it.
Afterwards, each aggregate (merged or split) would emit events to its own stream.
Another alternative might be to somehow migrate the events - but since an event store is append-only (for good reasons), we can’t just replace the existing events.
If we migrate the events to new streams, we obfuscate any temporal correlation that we might have had - not to mention that the read side projections will see both the old and migrated events…
What strategies could I use here?