Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introduction to Event Sourcing and CQRS
Search
Guilherme Augusto Henschel
February 17, 2018
Programming
0
500
Introduction to Event Sourcing and CQRS
An Introduction to Event Sourcing and CQRS presented at 11º PHPSC InCompany Meetup
Guilherme Augusto Henschel
February 17, 2018
Tweet
Share
Other Decks in Programming
See All in Programming
PostgreSQLのRow Level SecurityをPHPのORMで扱う Eloquent vs Doctrine #phpcon #track2
77web
2
540
AI時代のソフトウェア開発を考える(2025/07版) / Agentic Software Engineering Findy 2025-07 Edition
twada
PRO
93
31k
코딩 에이전트 체크리스트: Claude Code ver.
nacyot
0
690
ペアプロ × 生成AI 現場での実践と課題について / generative-ai-in-pair-programming
codmoninc
2
19k
なんとなくわかった気になるブロックテーマ入門/contents.nagoya 2025 6.28
chiilog
1
280
猫と暮らす Google Nest Cam生活🐈 / WebRTC with Google Nest Cam
yutailang0119
0
160
20250628_非エンジニアがバイブコーディングしてみた
ponponmikankan
0
700
すべてのコンテキストを、 ユーザー価値に変える
applism118
3
1.4k
スタートアップの急成長を支えるプラットフォームエンジニアリングと組織戦略
sutochin26
1
6.2k
レベル1の開発生産性向上に取り組む − 日々の作業の効率化・自動化を通じた改善活動
kesoji
0
240
PHPでWebSocketサーバーを実装しよう2025
kubotak
0
290
0626 Findy Product Manager LT Night_高田スライド_speaker deck用
mana_takada
0
180
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
351
20k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
Unsuck your backbone
ammeep
671
58k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.3k
The Cost Of JavaScript in 2023
addyosmani
51
8.5k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
Designing for humans not robots
tammielis
253
25k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
20
1.3k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
Code Review Best Practice
trishagee
69
19k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.7k
Transcript
11º PHPSC InCompany
Guilherme Augusto Henschel a.k.a. Cenoura developer since 2009 working @
Nexaas
Notice ✘ this talk intent is to open your mind
✘ use these patterns carefully ✘ remember, there is no silver bullet
ORM Customer Memory Database Customer Account owns name address account
Account accountNumber type balance
Event Sourcing
“ Event Sourcing ensures that all changes to application state
are stored as a sequence of events. — Martin Fowler
AccountCreated id: 123 owner: Guilherme H. 1 DepositPerformed accountId: 123
amount: $50 2 WithdrawalPerformed accountId: 123 amount: $20 3
Pros ✘ complete log of every state change ✘ easy
way to undo things ✘ testing, traceability and debugability ✘ business and data analysis of event streams ✘ immutability
Cons ✘ complexity ✘ time to get used to ✘
limited support from frameworks
When ✘ rich object-oriented domain models ✘ critical accountability and
debugability ✘ version control for data ✘ data can give you competitive advantage ✘ building scaleable systems based on CQRS pattern
CQS Command Query Segregation
“ every method should either be a command that performs
an action, or a query that returns data to the caller, but not both. — Bertrand Meyer
CQRS Command Query Responsibility Segregation
“ creating two objects where there was previously only one
Before
Improving
After
Pros ✘ scalability ✘ flexibility ✘ reduced complexity ✘ concentrate
on domain/business
Cons ✘ complexity
When ✘ task based user interfaces ✘ complex data processing
✘ disparity in reads and writes
Event Sourcing + CQRS
None
Libs/Components ✘Broadway - https://github.com/broadway/ broadway ✘Prooph - http://getprooph.org/
thanks! guilhermeaugusto.com.br
References ✘ Greg Young talk - https://www.youtube.com/watch?v=JHGkaShoyNs and https://cqrs.files.wordpress.com/2010/11/cqrs_documents.pdf ✘
Johannes Seitz talk - https://ookami86.github.io/event-sourcing-in- practice/ ✘ Martin Fowler articles - https://martinfowler.com/eaaDev/ EventSourcing.html and https://martinfowler.com/bliki/CQRS.html ✘ Marco Pivetta talk - https://www.youtube.com/watch?v=8NuHNtwjync ✘ http://www.cqrs.nu/ ✘ https://speakerdeck.com/owolf/cqrs-for-great-good ✘ https://speakerdeck.com/mattketmo/cqrs-and-event-sourcing