SlideShare a Scribd company logo
CQRS and Event Sourcing
with PHP
Who am I?
@marcelsud
Before we start
● Who knows what CQRS is?
● Who did already use CQRS in production?
● Who knows what Event Sourcing is?
● Who did already use Event Sourcing in production?
What CQRS is not?
● CQRS is not an architecture
● CQRS is not eventual consistency
● CQRS is not messaging
● CQRS is not eventing
● CQRS is not event sourcing
● CQRS is not CQS
● CQRS is not new
● CQRS is not hard to implement
● CQRS is not having separated models for reading and writing **
What is CQRS?
● Command and Query Responsibility Segregation
● It is essentially the creation of two objects
where there was previously only one **
Before
After
Or...
● Implement Event Sourcing
CQRS makes it easier to...
● Implement task based UIs
● Scale the read and write models independently
● Have multiple read models (which helps
reducing coupling)
● Tactician
Some libraries for CQRS
● SimpleBus
● Broadway
● Prooph
● Symfony Messenger
● State is built from the events
● No state is stored, only events
But what about Event Sourcing?
But what about Event Sourcing?
Picture from: https://www.confluent.io
Event Sourcing benefits
● It is possible to create data-views specialized for
certain cases
● It enables a 100% reliable audit log of the
changes made to a business entity
● It decouples the representation of current state in the
domain from the storage
● It facilitates the migration from monolithic
applications into smaller pieces
● It enables temporal queries that determine the state of
an entity at any point in time
Event Sourcing drawbacks
● It is a different and unfamiliar style of programming
and so there is a learning curve
● You’ll also probably have to introduce a little
more infrastructure to get up and running
● Not so simple onboarding of new team members
● Handling schema changes is not so simple as
the events are immutable
● To handle entities with long and complex
lifespans requires some “snapshot” strategy
CQRS and Event Sourcing with PHP
CQRS and Event Sourcing with PHP
CQRS and Event Sourcing with PHP
CQRS and Event Sourcing with PHP
CQRS and Event Sourcing with PHP
CQRS and Event Sourcing with PHP
CQRS and Event Sourcing with PHP
CQRS and Event Sourcing with PHP
What about Projections?
Picture from: https://goo.gl/btBWH1
CQRS and Event Sourcing with PHP
CQRS and Event Sourcing with PHP
Some libraries for Event Sourcing
● Broadway
● Prooph
● EventSauce
Any questions?
Thanks!
@marcelsud

More Related Content

Similar to CQRS and Event Sourcing with PHP (20)

PDF
CQRS and Event Sourcing with PHP - shorter version
Marcelo Santos
 
PPTX
Cqrs and Event Sourcing Intro For Developers
wojtek_s
 
PDF
fram^ TechTalk #1 - CQRS and Event Sourcing (ES)
Fram^ - IT Engineering & Venture Building
 
PPTX
LevelsConf 2018 Event Sourcing - Dasith Wijesiriwardena
Dasith Wijesiriwardena
 
PDF
An Introduction to event sourcing and CQRS
Haufe-Lexware GmbH & Co KG
 
PDF
A Visual Introduction to Event Sourcing and CQRS by Lorenzo Nicora
OpenCredo
 
PDF
A visual introduction to Event Sourcing and CQRS
Lorenzo Nicora
 
PDF
Introduction to Event Sourcing in PHP
Evan McMahon
 
PDF
Developing event-driven microservices with event sourcing and CQRS (Shanghai)
Chris Richardson
 
PDF
Developing event-driven microservices with event sourcing and CQRS (london Ja...
Chris Richardson
 
PPTX
Intro to event sourcing and CQRS
Savvas Kleanthous
 
PDF
Microservice Architecture with CQRS and Event Sourcing
Ben Wilcock
 
PPTX
Advance Microservice Patterns - Event Souring , CQRS
Mohit Mittal
 
PDF
CQRS and Event Sourcing in Action
Knoldus Inc.
 
PPT
Cqrs+es
Søren Mathiasen
 
PPT
Cqrs+es
Søren Mathiasen
 
PPTX
Event sourcing and CQRS
Rezwan Rafiq
 
PDF
Developing event-driven microservices with event sourcing and CQRS (svcc, sv...
Chris Richardson
 
PPTX
Design | expose ap is with cqr
Jabar Asadi
 
PDF
CQRS + Event Sourcing
Mike Bild
 
CQRS and Event Sourcing with PHP - shorter version
Marcelo Santos
 
Cqrs and Event Sourcing Intro For Developers
wojtek_s
 
fram^ TechTalk #1 - CQRS and Event Sourcing (ES)
Fram^ - IT Engineering & Venture Building
 
LevelsConf 2018 Event Sourcing - Dasith Wijesiriwardena
Dasith Wijesiriwardena
 
An Introduction to event sourcing and CQRS
Haufe-Lexware GmbH & Co KG
 
A Visual Introduction to Event Sourcing and CQRS by Lorenzo Nicora
OpenCredo
 
A visual introduction to Event Sourcing and CQRS
Lorenzo Nicora
 
Introduction to Event Sourcing in PHP
Evan McMahon
 
Developing event-driven microservices with event sourcing and CQRS (Shanghai)
Chris Richardson
 
Developing event-driven microservices with event sourcing and CQRS (london Ja...
Chris Richardson
 
Intro to event sourcing and CQRS
Savvas Kleanthous
 
Microservice Architecture with CQRS and Event Sourcing
Ben Wilcock
 
Advance Microservice Patterns - Event Souring , CQRS
Mohit Mittal
 
CQRS and Event Sourcing in Action
Knoldus Inc.
 
Event sourcing and CQRS
Rezwan Rafiq
 
Developing event-driven microservices with event sourcing and CQRS (svcc, sv...
Chris Richardson
 
Design | expose ap is with cqr
Jabar Asadi
 
CQRS + Event Sourcing
Mike Bild
 

Recently uploaded (20)

PDF
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
ESUG
 
PDF
AWS_Agentic_AI_in_Indian_BFSI_A_Strategic_Blueprint_for_Customer.pdf
siddharthnetsavvies
 
PPTX
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
PDF
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
PDF
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
PPT
Activate_Methodology_Summary presentatio
annapureddyn
 
PDF
Salesforce Pricing Update 2025: Impact, Strategy & Smart Cost Optimization wi...
GetOnCRM Solutions
 
PPTX
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
PPTX
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
PDF
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
PPTX
Employee salary prediction using Machine learning Project template.ppt
bhanuk27082004
 
PPTX
Presentation about Database and Database Administrator
abhishekchauhan86963
 
PDF
How Agentic AI Networks are Revolutionizing Collaborative AI Ecosystems in 2025
ronakdubey419
 
PDF
SAP GUI Installation Guide for macOS (iOS) | Connect to SAP Systems on Mac
SAP Vista, an A L T Z E N Company
 
PDF
Step-by-Step Guide to Install SAP HANA Studio | Complete Installation Tutoria...
SAP Vista, an A L T Z E N Company
 
PDF
Generating Union types w/ Static Analysis
K. Matthew Dupree
 
PDF
Supabase Meetup: Build in a weekend, scale to millions
Carlo Gilmar Padilla Santana
 
PDF
Why Are More Businesses Choosing Partners Over Freelancers for Salesforce.pdf
Cymetrix Software
 
PPTX
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
PDF
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
ESUG
 
AWS_Agentic_AI_in_Indian_BFSI_A_Strategic_Blueprint_for_Customer.pdf
siddharthnetsavvies
 
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
Activate_Methodology_Summary presentatio
annapureddyn
 
Salesforce Pricing Update 2025: Impact, Strategy & Smart Cost Optimization wi...
GetOnCRM Solutions
 
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
Employee salary prediction using Machine learning Project template.ppt
bhanuk27082004
 
Presentation about Database and Database Administrator
abhishekchauhan86963
 
How Agentic AI Networks are Revolutionizing Collaborative AI Ecosystems in 2025
ronakdubey419
 
SAP GUI Installation Guide for macOS (iOS) | Connect to SAP Systems on Mac
SAP Vista, an A L T Z E N Company
 
Step-by-Step Guide to Install SAP HANA Studio | Complete Installation Tutoria...
SAP Vista, an A L T Z E N Company
 
Generating Union types w/ Static Analysis
K. Matthew Dupree
 
Supabase Meetup: Build in a weekend, scale to millions
Carlo Gilmar Padilla Santana
 
Why Are More Businesses Choosing Partners Over Freelancers for Salesforce.pdf
Cymetrix Software
 
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
Ad

CQRS and Event Sourcing with PHP

  • 1. CQRS and Event Sourcing with PHP
  • 3. Before we start ● Who knows what CQRS is? ● Who did already use CQRS in production? ● Who knows what Event Sourcing is? ● Who did already use Event Sourcing in production?
  • 4. What CQRS is not? ● CQRS is not an architecture ● CQRS is not eventual consistency ● CQRS is not messaging ● CQRS is not eventing ● CQRS is not event sourcing ● CQRS is not CQS ● CQRS is not new ● CQRS is not hard to implement ● CQRS is not having separated models for reading and writing **
  • 5. What is CQRS? ● Command and Query Responsibility Segregation ● It is essentially the creation of two objects where there was previously only one **
  • 9. ● Implement Event Sourcing CQRS makes it easier to... ● Implement task based UIs ● Scale the read and write models independently ● Have multiple read models (which helps reducing coupling)
  • 10. ● Tactician Some libraries for CQRS ● SimpleBus ● Broadway ● Prooph ● Symfony Messenger
  • 11. ● State is built from the events ● No state is stored, only events But what about Event Sourcing?
  • 12. But what about Event Sourcing? Picture from: https://www.confluent.io
  • 13. Event Sourcing benefits ● It is possible to create data-views specialized for certain cases ● It enables a 100% reliable audit log of the changes made to a business entity ● It decouples the representation of current state in the domain from the storage ● It facilitates the migration from monolithic applications into smaller pieces ● It enables temporal queries that determine the state of an entity at any point in time
  • 14. Event Sourcing drawbacks ● It is a different and unfamiliar style of programming and so there is a learning curve ● You’ll also probably have to introduce a little more infrastructure to get up and running ● Not so simple onboarding of new team members ● Handling schema changes is not so simple as the events are immutable ● To handle entities with long and complex lifespans requires some “snapshot” strategy
  • 23. What about Projections? Picture from: https://goo.gl/btBWH1
  • 26. Some libraries for Event Sourcing ● Broadway ● Prooph ● EventSauce