Hello, I love the new discussion forum!
Sorry if this is a repeat, but this is a question I’ve scoured the mailing list and google for, but have not had luck finding a good answer.
Given that I’m using one event stream per aggregate, is it important to use names for my eventType
that are globally unique, even across different aggregates?
As a small contrived example, if my system has MortgageApplication
and CarLoanApplication
aggregates, it would make sense to the business owners if BOTH aggregate streams had a ContactAddressAdded
event. (Also assume the contents of the event data are also identical: street, city, etc ).
One the one hand, this might make it difficult if I had projections running on the $all
stream, listening for ContactAddressAdded
- I might not be able to easily distinguish what product the contact address is for?
However, making the names globally unique can make the event stream feel a bit more ham-fisted. For example, my mortgage log of:
[ ApplicationSubmitted, ContactAddressAdded ]
becomes
[ MortgageApplicationSubmitted, MortgageApplicationContactAddressAdded ]
…scaling that out into the full scope of the application, it seems the global names make things awkward. It also feels like the prefix means I need to be aware of ALL possible bounded contexts at the same time - and possibly breaks the idea that the same prefix might mean something different to different contexts.
It also seems like it could lead to rampant duplication of essentially the same logic, when my application offers 20 different types of financial products, all having the same concept of a “contact address”.
Are there any suggestions for best practice? Am I overthinking this? Thanks so much for your time!