Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CQRS and service bus

Tags:

cqrs

CQRS is about separating commands and queries. We can add it easily using several patterns & technologies like Event Sourcing, DDD, NoSQL, etc... but is ServiceBus mandatory?

like image 668
John Avatar asked Sep 28 '11 09:09

John


2 Answers

I'd say messaging and a service bus is optional.

CQRS simply means decomposing your application so that the Read and Write parts of your application can be optimized for the respective concern. Commands can be handled directy, even Events, if you decide to use them, can be dispatched synchronously.

A good reference for using an internal dispatcher is Greg Young's simple examle.

Update: Rob Ashton has just posted a very good article on what CQRS is and how not to make it more complicated than it actually is.

like image 90
Dennis Traub Avatar answered Nov 26 '22 18:11

Dennis Traub


No serviceBus is not mandatory, it's simply one of the technologies that be used to implement CQRS, for example Event Pub/Sub. If anything, Event Sourcing & DDD have a closer relationship to CQRS than ServiceBus.

like image 23
seanfitzg Avatar answered Nov 26 '22 16:11

seanfitzg