3 ms·
Did not know what CQRS is, did some light googling[1]: CQRS (Command and Query Responsibility Segregation) is an alternative to a simple CRUD-based database in
by rocqua 5y ago
Did not know what CQRS is, did some light googling[1]:
CQRS (Command and Query Responsibility Segregation) is an alternative to a simple CRUD-based database interface. CQRS separates reads and writes into different models, using commands to update data, and queries to read data.
Commands should be task-based, rather than data centric. ("Book hotel room", not "set ReservationStatus to Reserved").
Commands may be placed on a queue for asynchronous processing, rather than being processed synchronously.
Queries never modify the database. A query returns a DTO that does not encapsulate any domain knowledge.
The models can then be isolated, as shown in the following diagram, although that's not an absolute requirement.
[1]
- faizshah 5y agoI really like this book on CQRS & ES: https://www.amazon.com/Practical-Microservices-Event-Driven-Architectures-Sourcing-ebook/dp/B0899K5R4P https://www.amazon.com/Practical-Microservices-Event-Driven-... It’s a really practical treatment of CQRS & ES with JS examples. I had heard about CQRS & ES on HN for years but I had never seen any system that actually used it or any practical examples so this book is amazing cause it takes you through how to build a system using them.