In the Event Store / CQRS architecture, why are events stored instead of commands?

Presumably, we could have resurrected the state using the same set of commands, so why not just store commands, not events?

+7
source share
1 answer

Events, inform "it happened in our system." Events occur when a team has been accepted and processed. No one can reject or alter the fact that this happened. This is the only authoritative source of changes in the system.

Commands are just a way for a part of the system (for example, the user interface) to tell the component responsible for making changes to the system (the โ€œcommand handlerโ€) what it wants to do. However, the command handler may not process the command for various reasons. The user interface might have outdated information, and processing this command would not make sense in the business or the user would not have privileges to perform this action. In any case, the command is really just a request and is not related to the state of the system

.

+11
source

All Articles