We decided to extract out a new bounded context from a large existing one. Our events have this format:
<Context>::<Aggregate><Event>, an example could be: Shipping::CustomerAddressChanged.
Our stream names look like this: <Context>::<Aggregate>$<aggregate-id>.
So now, if we extract the example event to a new bounded context, we will end up with a new stream and new event names. Let’s say we name the new context “Delivery” (random, made up example).
This would change our event to Delivery::CustomerAddressChanged and the customer aggregate stream to Delivery::Customer$<aggregate-id>. This will obviously break building aggregate states, as we now need to consider the old and the new stream whenever we apply events.
We discussed this in the team today and came up with a good solution we think:
We can stop publishing to the first stream, create the new stream and publish a summary or snapshot event in there with our complete aggregate state. Now we change our consumers to be able to handle the snapshot event and switch them to listen to the new stream and all is good.
Does this make sense? Any problems with this solution? Any better ideas?