DEV Community


Discussion on: To Domain Driven Design

kmruiz profile image
Kevin Mas Ruiz Author

Hi Filip, thanks for the feedback!

I think I should have elaborated a bit more on the topic. When I mean state sourcing is something that I've implemented a few times on different projects that is based on propagating the whole state of an aggregate every time it changes.

We used this pattern for example with Kafka, where we had a topic per aggregate type, and we were sending the aggregate state partitioning using the domain id. This allowed us to replay the whole story of states of an aggregate easily to materialize new views.

You could do something similar with event sourcing, the difference is that events are meant to share domain knowledge, and state snapshots are meant to share information.

Thanks for reading!

fipil profile image
Filip Nowak

Hi Kevin, thank you for deep explanation!