CQRS + Event Sourcing: (is this correct) Commands are usually transmitted point-to-point, and Domain events are transmitted through pub / sub?

I don’t know how to shorten this title.

I'm mostly trying to wrap my head around the CQRS concept (http://en.wikipedia.org/wiki/Command-query_separation) and related concepts.

Although CQRS does not necessarily include Messaging and Event Sourcing, it seems like a good combination (as can be seen from the large number of examples / blog combining these concepts)

Given the precedent for a state change for something (say, to update the SO Question), would you consider the following thread to be the correct one (as in best practice)?

  • The system issues a summary UpdateQuestionCommand, which can be divided into several smaller commands: UpdateQuestion, which is designed for the aggregated root of the request and UpdateUserAction (for scoring, etc.), intended for the User Aggregate Root element. They are sent asynchronously using point-to-point messaging.

  • Aggregate roots do their job, and if everything goes well with the FireUpdated and UserActionUpdated events, respectively, which contain the state passed to the event store, which should be stored in yadayada, just to be complete, here.

  • These events are also queued for pub / sub for broadcast. Any subscriber (including probably one or more projectors creating Read Views) can subscribe to these events.

: , "-" (.. ), (I.e: )?

, /, pub/sub ?

: Saga (http://blog.jonathanoliver.com/2010/09/cqrs-sagas-with-event-sourcing-part-i-of-ii/) , , , , , .

, () .

.

+5
1

, Command Query ( , ), ()

+6

All Articles