Event Partitioning

Currently i’m trying to prototype some existing code again in the “EventSourcing” way.
The following is not technically realted to the eventstore as more to event sourcing in generall. Hope it is ok to still post it here. if not let me know.

Sometimes i find different possibilities how to partion occuring events in messages and streams. I feel unsure which partioning would be a good way

For example:

The User creates a customer wit a adress. In code i would create a customer entity with a collection of adresses which would then have one instance of the address the user has given.

Now would I send one create message for the customer which contains the customer AND the address ? Or would i spawn 2 messages “CustomerCreated” and “AdressLinked” ?

I would tend to send 2 messages. What is more common ?

Furthermore when having two events i would both spread through the “CustomerStream” right?

This really depends whether you’d consider the address to be part of the consistency boundary of the customer. It might be worth giving the “aggregates” section of domain driven design another look over for some more background on this.

In general you only want to be touching one aggregate per transaction in your system - unless the address has some intrinsic identity which requires it to live on beyond the user (i.e. it’s its own aggregate/consistency boundary) then put them in the same
stream, but without more background it’s hard to tell.

James