---
description: Command Query Responsibility Segregation
---

# CQRS

CQRS is a development principle claiming that a method must be either a command that performs an action or a request that returns data.

To put it simply, every action in Web API is either a request (get data) or a command (put data), but it shouldn’t do both. Consequently, each API method is divided into requests and commands.

The main advantage of this approach is that _get_ and _put_ operations are separated. Why is that important?

The practice has shown that 90 percent of requests concern _get_ operations; as a rule, they are small and quick. 10 percent of requests concern _put_ operations; these operations are usually complicated due to a range of transactions and validations.\
