Summary
CQRS is not just a Nest.js package. It is a pattern for designing and laying out your application. It requires that you split the command, creation and update of data, from the query, the retrieving of data, and aspects of your application. For small applications, CQRS can add a lot of unnecessary complexity so it’s not for every application. For medium and large applications, CQRS can help break apart complex business logic into more manageable pieces.
Nest.js provides two means of implementing the CQRS pattern, the command and event bus, and with some sugar in the form of sagas. The command bus isolates command execution to each module meaning a command can only be executed in the same module it is registered. Command handlers are not always asynchronous and limits other parts of the application from reacting to change. For this, Nest.js provides the event bus. The event bus is not isolated to a single module and provides a way for different modules of the same application...