We deal with complicated and complex applications on a daily basis, codebases that are filled with classes that do too many things. One design pattern that can help us with this is CQRS, Command Query Responsibility Seggregation. The idea behind CQRS is to split our models in two - the Command for writing, and the Query for reading. Applying CQRS can lead us to a more maintainable code, code that follows the SOLID principles more closely.

At the heart of CQRS lies the Service Bus - a transport mechanism responsible for dispatching our command, event, and query messages to their destinations.

This talk will give an overview of the CQRS pattern and take a closer look at the different types of service buses - command, event, and query ones. Main takeaway will be practical information on why, when, and how to use them, with emphasis on their differences. We'll also take a look at some of the PHP libraries out there that help us work with service buses like Prooph Service Bus, Simple Bus, Tactician, to name a few.


Comments are closed.

Miro Svrtan at 14:22 on 16 Feb 2018

Only times I noticed Robert being nervous was when he had short brakes telling us he was nervous :) , it's so nice to see you confident on the outside just need to work on the inner confidence.

Pace was good, neither slow nor fast, slides were just right.

I have few small suggestions for the code on the slides:
- put suffixes to class names (instead of UpdatePriceAction call it UpdatePriceActionController, UpdateProductPriceCommand instead of UpdateProductPrice so it would be more clear to the audience what class represents)
- use Money instead of doubles for price hints (or at least integers) so people avoid floating point round-off errors
- I would not suggest using Entities in commands, as handler could change the values inside and controller/service sending the command would be aware of it -> they reference same instance

Nice talk. Maybe . the intro part could be shorten a bit in favor of the "meat" of the talk though.

Nino Uzelac at 18:26 on 7 Mar 2018

Flawless English, but it was a bit boring for me, intro was long and examples were too simple and I just didn't catch the benefit over using some other pattern (repositories, services).

Zgphp meetup at 17:14 on 8 Mar 2018

First of all, thanks for coming to Zagreb to talk about this topic. I find it personally very interesting and it is always a pleasure to hear more about CQRS.

The talk was great, well rehearsed and I really enjoyed examples of bad and best practice.
I've never heard of query bus before, and the example of throttling queries by using the bus was eye-opening.

Nice talk, but the intro could be shorter with more concrete examples.

Intro was too long and not so relevant, slides need more work, and in the end I still don't understand how or why would I use a service bus.