Posts

Showing posts from October, 2017

CQRS - Command Query Request Segregation

Overs the years i have the idea of decoupling the query and actions on a resource and came up with examples where ever I could. Bit i was not able to articulate the same in terms of a pattern. I recently found there is a similar pattern and obviously a popular pattern in today microseconds world. This pattern is called CQRS(Command Query Request Segregation). Yes, I know, who would have come up with such a mouthful, but the underlying concept is pretty simple. This pattern specifies that all queries and command (actions that mutate state) should be segregated. This means an API to access a resource should segregated the query and command interfaces. This would help the API consumer and producer in managing and consumer the api easily without worrying about unintended side effects. Thuis pattern is particularly useful in a microseconds architecture. Also another pattern which gels well with CQRS is Event Sourcing. Event Sourcing is the processing of mutating state via events rath...