This is the internal structure of CQRS. There is no specific framework to follow. Systems aren’t always fully CQRS compliant and have modifications according to their needs. I am going to use infographics to give a more detailed view and easy understanding. You don’t have to follow this system; it’s just to understand the idea.
Details
The idea of separating the read write models is applied for leaving you with an option of scalability and flexibility. But, most systems use the same model for the view, that they use for the read and write model. This is not a good way to use it because you should only provide the information in the view that is required, no need to provide extra information. Also, it’s a better way of performing the domain encapsulation, so that your domain objects are not visible to the outside world. As seen, an action or set of actions could generate a number of events which are stored in event stores.
In the infographics, I tried to explain the infrastructure involved in a complex system. Off course, that is not a real system which probably would be much more complex and a lot different than this system. In banking sectors, we always calculate the remaining balance as an aggregate of transactions. Use the same thinking when it comes to any other system dealing with events. So, when we see the aggregate of the event, we see the final state of the system. We can’t remove any event, else we will lose its state.
,You can see here, if we delete one event, we will have a different result.
The other part of the system is those multiple DBs or tables dedicated for those systems. That is kind of similar in CQRS too. In CQRS, it’s better to have one table for a view. So, in our simple example, if we have an ATM, we don’t need to save all the transaction history and personal detail of account to the DB, but all we want is just the identification and balance history. From that, we can show and conclude different operations.

Vignesh ManiPosted Jul 15, 2016, 4:27 PM
Nice