I am new at CQRS and want advice how to implement this over an legacy system.
I have some questions:
The database will remain in the legacy system. I'm guessing right that we do not have any use for Event Sourcing?
Some commands will take time to perform (anywhere from a few seconds to a few minutes). How do we handle it with CQRS?
I am looking to solve this as follows:
- Client sends UpdateSomeDataCommand
- UpdateSomeDataHandler creates a new thread that retrieve the data from the legacy system
- The client use the read model to get cached data and present it to the user
- When the UpdateSomeDataHandler is ready to retrieve data, it sends the SomeDataUpdated event
- The read model react to SomeDataUpdated and store the new data in its cache database
- The read model use INotifyPropertyChanged to notify the client that updated data is available.
- The client retrieves the update data from the read model and present it to the user.
It feels a like I'm doing it wrong. But I can not think of anything better.