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
Freek Van der Herten
April 10, 2019
Programming
0
520
Event Sourcing in Laravel (Full Stack Ghent)
Freek Van der Herten
April 10, 2019
Tweet
Share
More Decks by Freek Van der Herten
See All by Freek Van der Herten
Uncharted packages (ode aan de code)
freekmurze
0
55
Uncharted packages (Laravel Live Denmark)
freekmurze
0
250
I shall define this only once
freekmurze
0
470
An Introduction to Snapshot testing
freekmurze
0
540
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
900
A practical look at multitenancy in Laravel
freekmurze
1
390
A practical look at multitenancy in Laravel (Laracon US)
freekmurze
0
770
Other Decks in Programming
See All in Programming
Python’s True Superpower
hynek
0
200
15年目のiOSアプリを1から作り直す技術
teakun
1
610
ご飯食べながらエージェントが開発できる。そう、Agentic Engineeringならね。
yokomachi
1
290
NOT A HOTEL - 建築や人と融合し、自由を創り出すソフトウェア
not_a_hokuts
2
590
AI時代でも変わらない技術コミュニティの力~10年続く“ゆるい”つながりが生み出す価値
n_takehata
2
650
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
170
2026年は Rust 置き換えが流行る! / 20260220-niigata-5min-tech
girigiribauer
0
220
朝日新聞のデジタル版を支えるGoバックエンド ー価値ある情報をいち早く確実にお届けするために
junkiishida
1
380
AIコーディングの理想と現実 2026 | AI Coding: Expectations vs. Reality 2026
tomohisa
0
1.1k
Go 1.26でのsliceのメモリアロケーション最適化 / Go 1.26 リリースパーティ #go126party
mazrean
1
350
オブザーバビリティ駆動開発って実際どうなの?
yohfee
3
740
nilとは何か 〜interfaceの構造とnil!=nilから理解する〜
kuro_kurorrr
3
1.7k
Featured
See All Featured
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
150
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
140
GraphQLの誤解/rethinking-graphql
sonatard
75
11k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Music & Morning Musume
bryan
47
7.1k
First, design no harm
axbom
PRO
2
1.1k
So, you think you're a good person
axbom
PRO
2
1.9k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
130
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
470
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
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