From the course: Software Architecture: Patterns for Developers

Unlock the full course today

Join today to access over 24,000 courses taught by industry experts.

CQRS

CQRS

- [Instructor] Let's take a look at the Command Query Responsibility Segregation pattern. Command Query Responsibility Segregation, or CQRS, is a pattern where we have two entirely separate models in our application. One that we use to read from the database and one to write to the database. Separating these two, allows you to have pieces in your database that are geared towards specific scenarios. This can improve performance, and reduce the amount of complex queries you have. You could even have a separate database for your queries. However, this will require you to synchronize the tables or databases. CQRS is often implement together with event sourcing. But it doesn't have to be. We'll be covering event sourcing and the combination of the two later in this course. A diagram will clarify some things. We'll start with an application that has a UI, a piece of read logic, that contains the read model, and a similar…

Contents