CQRS Pattern in Ruby

Category: Design Patterns :: Published at: 19.05.2022

In simple words CQRS is dividing the reading part of the model from the writing part.

Instead of one, we have 2 models with different responsibilities.

CQRS is used to make our code safer, more scalable, and easier to understand.

The read site in CQRS is very fast, cause it is used only to simple read commands.

The write site is more complicated, it is used when we want to implement validations,
use domaing logic or to keep data persistence.

The real challenge about CQRS is the fact that you need 2 data stores (read and write data stores).
It can possibly be inside one database but quite often we are working here with 2 seperate databases.

- Click if you liked this article

Views: 288