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
Event Sourcing in Laravel (Full Stack Ghent)
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Freek Van der Herten
April 10, 2019
Programming
520
0
Share
Event Sourcing in Laravel (Full Stack Ghent)
Freek Van der Herten
April 10, 2019
More Decks by Freek Van der Herten
See All by Freek Van der Herten
Uncharted packages (ode aan de code)
freekmurze
0
62
Uncharted packages (Laravel Live Denmark)
freekmurze
0
250
I shall define this only once
freekmurze
0
470
An Introduction to Snapshot testing
freekmurze
0
550
Event Sourcing In Laravel
freekmurze
0
280
Building a realtime dashboard with Laravel Livewire (PHPKonf)
freekmurze
0
860
A tour behind the scenes of Oh Dear (PHP Benelux)
freekmurze
2
910
A practical look at multitenancy in Laravel
freekmurze
1
400
A practical look at multitenancy in Laravel (Laracon US)
freekmurze
0
780
Other Decks in Programming
See All in Programming
存在論的プログラミング: 時間と存在を記述する
koriym
5
850
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
760
事業会社でのセキュリティ長期インターンについて
masachikaura
0
240
LM Linkで(非力な!)ノートPCでローカルLLM
seosoft
0
450
安いハードウェアでVulkan
fadis
1
940
「接続」—パフォーマンスチューニングの最後の一手 〜点と点を結ぶ、その一瞬のために〜
kentaroutakeda
5
2.5k
「話せることがない」を乗り越える 〜日常業務から登壇テーマをつくる思考法〜
shoheimitani
4
640
forteeの改修から振り返るPHPerKaigi 2026
muno92
PRO
3
260
ハンズオンで学ぶクラウドネイティブ
tatsukiminami
0
110
10 Tips of AWS ~Gen AI on AWS~
licux
5
200
ドメインイベントでビジネスロジックを解きほぐす #phpcon_odawara
kajitack
2
130
Go_College_最終発表資料__外部公開用_.pdf
xe_pc23
0
160
Featured
See All Featured
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
160
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
460
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
370
A Modern Web Designer's Workflow
chriscoyier
698
190k
Color Theory Basics | Prateek | Gurzu
gurzu
0
290
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Everyday Curiosity
cassininazir
0
190
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
200
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
Optimizing for Happiness
mojombo
378
71k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
Transcript
Getting started with event sourcing in Laravel
About me Freek Van der Herten Partner & developer at
Spatie @freekmurze murze.be ohdear.app
Spatie Laravel, front-end development Since 2003 9 awesome human beings
Open Source Software
We create a lot of it ± 200 packages on
Packagist ± 2,000,000 downloads a month ± 30,000,000 total downloads All Postcardware!
Highlights Popular laravel-backup laravel-medialibrary laravel-permission New laravel-query-builder laravel-blade-x
https://spatie.be/open-source
https://spatie.be/open-source/postcards
Let's talk about event sourcing
Talk overview Theory Projectors demo Aggregates demo
Theory
Traditional application Write data in database An update means overwriting
the old data The old data cannot be accessed anymore
APPLICATION DATABASE TABLE value X
APPLICATION DATABASE TABLE value X value Y
Event Sourced Application The application will fire off events Events
will get written in a dedicated store Events are passed to consumers that create projections Aggregate, Aggregate Root...
APP EVENTS Event Event 1
APP EVENTS Event Event 1 Event 2
APP EVENTS Event Event 1 Event 2 Event 3
APP CONSUMER EVENTS PROJECTION Event Event 1 Event 2 Event
3
APP CONSUMER CONSUMER 2 EVENTS PROJECTION Event Event 1 Event
2 Event 3 ANOTHER PROJECTION
APP CONSUMER CONSUMER 2 EVENTS PROJECTION Event Event 1 Event
2 Event 3 ANOTHER PROJECTION
APP CONSUMER CONSUMER 2 EVENTS PROJECTION Event Event 1 Event
2 Event 3 Event 4 ANOTHER PROJECTION
Event Sourced Application Auditing requirements Extra reports needed Recording the
unhappy path There is some setup required
Laravel Event Projector
Laravel Event Projector Package made by Spatie Aggregates, Projectors &
Reactors Beautifully integrated into Laravel Easy to get started with
https://docs.spatie.be/laravel-event-projector
Demo
Aggregates
None
None
None
None
None
None
Demo
In closing
Summary Laravel Event Projector Easy to use package to get
started with event sourcing Projectors Replay capabilities Aggregates
Writes are harder, reads are easier
Event sourcing makes the easy things harder… …and the harder
things easier — Frank De Jonge
Larabank github.com/spatie/larabank-traditional github.com/spatie/larabank-event-projector github.com/spatie/larabank-event-projector-aggregates github.com/spatie/larabank-eventsauce
Resources kickstarter.engineering/event-sourcing-made-simple-4a2625113224 github.com/spatie/laravel-event-projector github.com/eventsaucephp/eventsauce github.com/prooph
Thank you! speakerdeck.com/freekmurze/event-sourcing-full-stack-ghent spatie.be/open-source murze.be ohdear.app