So I'm comfortable with the basic concept of CQS, where you might have a command that writes to one database, and that updates the query database that you read from.
However, consider the scenario where you are entering data, and want to prevent duplicates.
Using new employee data entry an employee register as an example, working through a pile of application forms to key in the new employees' details:
- Take top sheet.
- Key in employee name and unique payroll number to UI.
- Submit.
- Put paper in "completed pile".
- Repeat.
How would you now prevent the user from keying in the same payroll number again, say for instance if they get distracted and can't remember whether they've keyed one in already and the "message" hasn't got all the way back to the query db for the user to search?