How will you get used to CQRS if you never use it?
Arguments about the domain is not that complex, CRUD is a better fit, and so on are straw-man arguments. Because, how do you know if a domain is not complex? For how long will it stay that way? And how do you get experience with CQRS (and event sourcing) if you decide to never use it?
We have to learn, so why not pick the simple domain and lower the risk while doing it?
Reminds me of an assignment where the domain was parking tickets. At some point the business decided we would need logs. One would show the history of changes for an entity, an other would show all changes done by a case handler.
How do you create a log that contains different things like:
- Ann uploaded 2 images to ticket #123
- Ruth deleted 1 image to ticket #123
- Eric changed amount from $90 to $50 on ticket #123
- Ruth shredded ticket #123
If we know up front all the things this log would ever show, then we could implement something CRUD style. But in this case, the business didn't know other than 'we need it for future checks and auditing'.
I can't see a better fit for event sourcing, even if you don't want the event store to be source of truth:
- Generate the events
- Use them to update the CRUD store
- Save them
- Replay / project them whenever the logging requirements change
But I failed to convince my tech-lead, because 'it was so much code'. And until C# get records, it is.
--Thomas