Introducing Command Query Responsibility Separation (CQRS)
page 2 of 5
by Steven Smith
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 33098/ 98

The CQRS Pattern

The Command Query Responsibility Separation pattern introduces a logical separation between read and write operations within a distributed application.  There are several reasons for and benefits that result from this separation, as well as some application design implications.  Typically, the CQRS pattern is implemented by introducing the concept of message queues into an application, eliminating the need for direct access to the central data store for write operations for the application.

The intent of CQRS is to allow the individual nodes in a distributed application (assuming it is a web-based application, these would be the web servers) to handle user requests with a minimum of interaction with or dependency on difficult-to-scale resources (most often, the central data store, but also other resources such as sending emails).  This is can be achieved by creating a local read-only copy of the data the individual node requires (for Queries) and introducing a reliable messaging system that can handle writes (for Commands) in an offline, asynchronous fashion.  As individual user requests come into the server, it reads data from its local store, and writes any Commands to its local message queue (which is then picked up and handled outside of the web application and its limited pipeline).  The result is a huge increase in performance and scalability for the web node, since there is no longer synchronous, transactional access to a single, shared data store involved in each request.

View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2021  |  Page Processed at 2021-12-01 7:09:56 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search