Command Query Responsibility Segregation
Command Query Responsibility Segregation (CQRS) is an extension to software development principle “Separation of Concerns.” CQRS is implemented by a number of software patterns resulting in a highly scalable solution.
The basic concept of CQRS is that of a Command and a Query. A command creates or modifies data. A Query retrieves data. In a CQRS model, writing data is one responsibility, and reading data is another. Even though modern applications frequently require both responsibilities, separating the execution of the results in a more robust, and scalable, application.
This separation of responsibility is not necessarily tied to a database; It could be working with in memory objects, and the query simply returning state.
In other systems, the separation may be tied to one or more databases. In fact, Commands (writes) may be written into a message queue or staging database. Another process manipulates the data and writes it to data marts, relational databases, or even a data warehousing schema. Then Queries are pulled from the permanent data stores indirectly tied to the Command generating the data.
SQL Server has been extended in many ways allowing it to participate in different patterns implementing the CQRS principle. The Data Broker capabilities are one example of enabling technologies.
Have you used CQRS in your system effectively? Why not share your experience with us by writing btaylor@sswug.org. If you’d like to read more about CQRS, do a quick google search. Also, CodePlex has a sample application built in Dot net you can pull down by searching CodePlex for CQRS.
Cheers,
Ben
$$SWYNK$$
Featured Article(s)
Getting Started with Contained Databases
The "partially contained databases" feature is a new and robust security feature of SQL Server. This feature is one of the coolest features of SQL Server 2012, which improves the portability of databases across instances of SQL Server. This article demonstrates the "partially contained databases" feature of SQL Server 2012 and outlines this features limitations.
Featured White Paper(s)
Migrate to SQL Server’s next release with ease and optimize the database workload at any time.
read more)