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
480
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
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
210
Zoneless Testing
rainerhahnekamp
0
140
Webエンジニア主体のモバイルチームの 生産性を高く保つためにやったこと
igreenwood
0
350
Jakarta EE meets AI
ivargrimstad
0
360
ドメインイベント増えすぎ問題
h0r15h0
2
510
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
8
1.7k
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
800
Оптимизируем производительность блока Казначейство
lamodatech
0
800
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
310
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
200
Amazon S3 NYJavaSIG 2024-12-12
sullis
0
130
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
370
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
244
12k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
171
50k
Code Reviewing Like a Champion
maltzj
521
39k
Building Applications with DynamoDB
mza
92
6.1k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
111
50k
Done Done
chrislema
182
16k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
How to Ace a Technical Interview
jacobian
276
23k
Six Lessons from altMBA
skipperchong
27
3.5k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
Site-Speed That Sticks
csswizardry
2
210
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
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