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
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
400
API Platformを活用したPHPによる本格的なWeb API開発 / api-platform-book-intro
ttskch
1
130
株式会社 Sun terras カンパニーデック
sunterras
0
2.1k
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
720
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
190
AIコーディングの理想と現実 2026 | AI Coding: Expectations vs. Reality 2026
tomohisa
0
1.2k
Claude Codeセッション現状確認 2026福岡 / fukuoka-aicoding-00-beacon
monochromegane
4
410
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
5
760
AIに任せる範囲を安全に広げるためにやっていること
fukucheee
0
130
エージェント開発初心者の僕がエージェントを作った話と今後やりたいこと
thasu0123
0
240
20260228_JAWS_Beginner_Kansai
takuyay0ne
5
480
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
270
Featured
See All Featured
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
230
Building Flexible Design Systems
yeseniaperezcruz
330
40k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.5k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.3k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
250
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
670
A Soul's Torment
seathinner
5
2.4k
The World Runs on Bad Software
bkeepers
PRO
72
12k
sira's awesome portfolio website redesign presentation
elsirapls
0
190
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
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