5 ms·
Been looking into CQRS and people's thoughts/examples/implementation are as wide and varied as the stars. The answer straight from the horse's mouth (Greg Youn
by c17r 6y ago
Been looking into CQRS and people's thoughts/examples/implementation are as wide and varied as the stars.
The answer straight from the horse's mouth (Greg Young): https://web.archive.org/web/20190211113420/http://codebetter.com/gregyoung/2010/02/16/cqrs-task-based-uis-event-sourcing-agh/ https://web.archive.org/web/20190211113420/http://codebetter...
CustomerService
void MakeCustomerPreferred(CustomerId)
Customer GetCustomer(CustomerId)
CustomerSet GetCustomersWithName(Name)
CustomerSet GetPreferredCustomers()
void ChangeCustomerLocale(CustomerId, NewLocale)
void CreateCustomer(Customer)
void EditCustomerDetails(CustomerDetails)
goes to
---------
CustomerWriteService
void MakeCustomerPreferred(CustomerId)
void ChangeCustomerLocale(CustomerId, NewLocale)
void CreateCustomer(Customer)
void EditCustomerDetails(CustomerDetails)
---------
CustomerReadService
Customer GetCustomer(CustomerId)
CustomerSet GetCustomersWithName(Name)
CustomerSet GetPreferredCustomers()
---------
and that's it. No Task/mediator architectures, no event sourcing, nothing.
- hn_throwaway_99 6y agoWhile I totally agree with this, I feel like at this point it's a little like the gif/jif argument. I don't really care that much if the original author pronounces it like the peanut butter, almost nobody else does. With CQRS, this is pretty trivially implemented in GraphQL as GraphQL explicitly separates queries from mutations (this is my favorite blog on the topic, https://www.apollographql.com/blog/designing-graphql-mutations-e09de826ed97/ https://www.apollographql.com/blog/designing-graphql-mutatio... ), but for some reason nobody talks about it as CQRS when they implement it like that. In fact, in the past 5ish years I've only heard about CQRS in an architecture that also used event sourcing.
- victor106 6y agothis makes sense. see also https://cqrs.files.wordpress.com/2010/11/cqrs_documents.pdf https://cqrs.files.wordpress.com/2010/11/cqrs_documents.pdf