CQRS Explained in 5 MINUTES | What is CQRS?

Marco Lenzo
Marco Lenzo
31.6 هزار بار بازدید - پارسال - CQRS stands for Command and
CQRS stands for Command and Query Responsibility Segregation. The term was introduced by Greg Young in 2010 to describe a pattern that advocates for clear code separation between the state mutation and data retrieval. If we imagine a traditional layered architecture, CQRS slices our core application logic vertically, creating two models: one used for reads and the other used for writes.

When compared  to CRUD, Read operations map to Queries, while Create, Update and Delete operations are replaced by Commands.

In its strict definition: a command is not data centric. It is not about creating, updating or deleting a single record on our database. A Command represents the intention to perform a task. It maps more closely to a complex business operation like generating an invoice, booking a hotel room, or provisioning a bare metal server.

CQRS can also help satisfy high performance and scalability requirements, especially when combined with a microservices architecture and asynchronous processing.

Greg Young himself describes CQRS more as a stepping stone towards event sourcing. It was a way to facilitate the necessary mental model switch that is required when working with an append only event log. If you are interested in the topic, you can watch the original clip https://youtube.com/clip/UgkxIQJ6SSRp...

🤓 There's more on my website! (articles, scripts, code snippets, etc...): 🤓
https://marcolenzo.eu/

🤝 Connect with me: 🤝
LinkedIn: marcolenzo

👌Get a CodeCrafter Discount 👌
https://app.codecrafters.io/join?via=...

#systemdesign #softwarearchitecture #softwaredevelopment
پارسال در تاریخ 1401/12/15 منتشر شده است.
31,679 بـار بازدید شده
... بیشتر