Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3307376
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:23:57+00:00 2026-05-17T21:23:57+00:00

CQRS has got me into thinking mode.. I am tryinng to start a new

  • 0

CQRS has got me into thinking mode.. I am tryinng to start a new project with CQRS ideas. The main things that I like is
1) the separation of Query and Command. Our Domain queries have been a problem.
2) Using Event Storage for Audit – I wont be using it for Replay – AT least not now.

I am good with the query side and I still have some questions on Domain Events

If a Command results in updation of Multiple Aggregates Roots( Ex. Order and OrderDetail) I will have the them scoped under UnitofWork ( transactional). Now each domain is responsible for publishing events when a change takes place to its state.

let us say the command changes 3 orderDetail records. Each OrderDetail will publish 2 Events. In the end we have 6 events .

a) If I publish the events as soon as I have made the changes to the domain object ( but not committed the transaction) how do I reverse the events that have been published (and may have been consumed by subscribers)

  • What I can think of is to hold the events to be published in a list ‘under the same unit of work scope’ and once the committ on transaction has been called, store it and publish it . Does this sound something one would do.

b) If the changes in OrderDetail requires that some change also take place in Order Aggregate Root then
i) Should I base those changes by handling the events published by OrderDetail Aggregate ? For ex. let us say two Order Detail were removed. This makes Order status from “preferred” to “Not preferred” .
ii) What if the Event errors and does not update order state – If order remains preferred then it gets shipped in 2 days.

Adding another question
c) Are “Domain events are the source of all application state changes” or are they “Result of all application state changes”

Thank you in Advance,

The Mar

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:23:58+00:00Added an answer on May 17, 2026 at 9:23 pm

    a) you should not publish events until your transaction is commited, an event reprsent something that has happened, and hence the reason why they are all named in pass tense (eg OrderClearedEvent). Also in the case that you have to “revert” an event, you should take a corrective action, ie you dont erase the event, you must trigger a new event that corrects the effects of the event you want to revert

    b) it seems that this is more of a problem on how you are modelling you entities and commands that anything else. I cant think of a reason why OrderDetail would be an AggregateRoot, but I dont know your domain…

    c) Commands will result in at least one event being published

    Hope this helps 🙂 As Rinat said, the google group is the best place for asking questions, also have a look at cqrsinfo.com and the sample code from github.com/MarkNijhof/Fohjin and github.com/gregoryyoung/m-r

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my CQRS architecture, I'd like to validate that when I send a InsertSettingCommand
Getting into CQRS and I understand that you have commands (app layer) and events
I have a project that is using CQRS and Dependency Injection. The Query side
I'm trying to use CQRS and EventSorcing in my new project. I'm following the
We're starting a new project where we want to implement CQRS + Event Sourcing
I am mainly a business app developer and I hear terms like CQRS, ServiceBus,
I have my first CQRS project which uses event sourcing and I was wondering
One of the basic tenets of CQRS, as I understand it, is that commands
My team has been tasked to create an application that follows the task-based UI
I'm new to the idea of CQRS, and as usual deciding how to name

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.