--
You received this message because you are subscribed to the Google Groups "DDD/CQRS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "DDD/CQRS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dddcqrs/wtJbvLUmh5k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dddcqrs+u...@googlegroups.com.
Philip thanks for this detailed reply. I have 2 questions - hope you do not mind:
(1) I thought the read model should be totally independent of the write model? But if you have a pull model, as you suggested, is the read model not somehow coupled to the write/domain model (i.e. it has to tell the write/domain model - give me all events x and y)? I thought that a bus/publisher-subscriber pattern (in memory our not) decouples things. Hence, there is no bidirectional communication taking place.
(2) You mention 'reporting database'. Are you suggesting that the reporting database is separate from the read model and if so how is it kept up to date?
Excellent! Thanks very helpful reply.
Sorry one more question. Am I right to assume that the write model only exists if there is no event sourcing?
I think I understand this. IMHO the write model is the persited domain model if there is no event store. However, if there is an event store the domain model's aggregate roots are hydrated via the events and/or the snapshots/mementos. The domain model also reacts to commands whilst generating domain events. Please correct me if I am wrong.
In case of DDD, the domain model is the write model - the logic which generates events reacting on commands.
In particular, I dislike the term "republish events". Events get published, after that they are just that - published (aka publicly available).
I think I understand this. IMHO the write model is the persited domain model if there is no event store. However, if there is an event store the domain model's aggregate roots are hydrated via the events and/or the snapshots/mementos. The domain model also reacts to commands whilst generating domain events. Please correct me if I am wrong.
Thanks.
I think I understand this. IMHO the write model is the persited domain model if there is no event store. However, if there is an event store the domain model's aggregate roots are hydrated via the events and/or the snapshots/mementos. The domain model also reacts to commands whilst generating domain events. Please correct me if I am wrong.
Excellent reply again makings much clearer. Thanks!. Yeah, I have to unlearn a few things (my ORM 'domain' models tended to be quite data centric/anemic so far with no real separation between reading and writing concerns). Thanks again.
As far as control-flow is concerned, a pull model decouples better: if you use a push strategy, the publishing side has to keep track of/ensure that all interested parties get all the events. Also, if you need to rerun a projection, the publishing side needs to be actively involved ("republish"). If distributing, you need heavy middleware to guarantee delivery. IMHO this is quite unfavourable design. In a pull model, the publishing side (here: event store) offers any events for retrieval and offers subscriptions to a pointer to the latest chunk of events/transaction/whatever you call it. Subscribers are responsible for knowing what events they processed to far. If a subscriber missed some notifications, it just retrieves the missing events lateron. If you have a new subscriber (or reset a subscriber's read model storage), you just retrieve all of the relevant history once for initial processing before resuming normal operations. Your publisher does not need to be aware of subscribers' states at all -> decoupling.