I would like to have a simple CQRS implementation on an API. In short:
- Separate routes for Command and Query.
- Separate DB tables (on the same DB at the moment). Normalized one for Command and a de-normalized one for Query.
- Asynchronous event-driven update of Query Read Model, using existing external Event Bus.
After the Command is executed, naturally I need to raise an event and pass it to the Event Bus. Event Bus would process the event and pass it to it's subscriber(s). In this case the subscriber is Read Model which needs to be updated.
So I need a callback route on the API which gets the event from Command Bus and updated the Read Model projection (i.e.: updating the de-normalized DB table which is used for Queries).
The problem is that the update of the Read Model projection is neither a Command (we do not execute any Domain Logic) nor a Query.
The questions is: How should this async Read Model update work in order to be compliant both with CQRS and DDD?