Transform Aggregate

Hi Axon lovers,

sometimes it happens, that a decisssion for an aggregate was wrong and I want to delete or transfer properties from an aggregate. How can I practcally achive this, especially if I’m using snapshots?

Lets say, I have an UserAggregate and I made a wrong decsission to put VideoLikes in it … Now I want an extra Aggregate for VideoLikes … On UserAggregate I added a Snapshotter. What is the best way to remove the Likes from UserAggregate and put it into VideoLikeAggregate?

Greets
Denis

Hi Denis,

You essentially have the requirement to pull apart the aggregate event stream into two event streams.
Snapshots in this case isn’t the big issue. Those can simply be removed and recreated when needed.
They are just a short term replacement to fasten load speed of the aggregate, so I wouldn’t see any issue just dropping them.

Splitting up an Aggregate event stream is a different operation entirely however…
As it currently stands, Axon (neither Framework nor Server) does not provide any tools when it comes to pulling an Aggregate event stream apart into distinct aggregate streams.
This thus means you will have to write a one-off tool which does the exact operations you want to do.
Like, which event goes to which aggregate stream? What is the new identifier of this other stream? Do I need to make any additional event modification next to the aggregate identifier?

Trust me if I say we are debating how to implement this in a user friendly way.
For now though, it will require some handy work from your team, my apologies.
Lastly, if these events and the aggregates they stem from are not production data, I wouldn’t bother with pulling them apart.
This opts for a simple “let’s start from scratch approach”.

Trusting this clarifies things for you Denis!

Cheers,
Steven

PS. It is important to note that this mailing list will be discontinued as specified in this thread.
Instead of this mailing list we have moved to use a forum style of communication, at https://discuss-next.axoniq.io/.

Hope to see you there!