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
500
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
26
Uncharted packages (Laravel Live Denmark)
freekmurze
0
220
I shall define this only once
freekmurze
0
420
An Introduction to Snapshot testing
freekmurze
0
510
Event Sourcing In Laravel
freekmurze
0
260
Building a realtime dashboard with Laravel Livewire (PHPKonf)
freekmurze
0
830
A tour behind the scenes of Oh Dear (PHP Benelux)
freekmurze
2
860
A practical look at multitenancy in Laravel
freekmurze
1
360
A practical look at multitenancy in Laravel (Laracon US)
freekmurze
0
740
Other Decks in Programming
See All in Programming
スマホから Youtube Shortsを見られないようにする
lemolatoon
27
32k
Goで実践するドメイン駆動開発 AIと歩み始めた新規プロダクト開発の現在地
imkaoru
4
840
TFLintカスタムプラグインで始める Terraformコード品質管理
bells17
2
170
私達はmodernize packageに夢を見るか feat. go/analysis, go/ast / Go Conference 2025
kaorumuta
2
560
なぜGoのジェネリクスはこの形なのか? Featherweight Goが明かす設計の核心
ryotaros
7
1.1k
Go言語の特性を活かした公式MCP SDKの設計
hond0413
1
230
CSC305 Lecture 03
javiergs
PRO
0
240
Web フロントエンドエンジニアに開かれる AI Agent プロダクト開発 - Vercel AI SDK を観察して AI Agent と仲良くなろう! #FEC余熱NIGHT
izumin5210
3
530
2分台で1500examples完走!爆速CIを支える環境構築術 - Kaigi on Rails 2025
falcon8823
3
3.6k
コードとあなたと私の距離 / The Distance Between Code, You, and I
hiro_y
0
170
Things You Thought You Didn’t Need To Care About That Have a Big Impact On Your Job
hollycummins
0
230
10年もののAPIサーバーにおけるCI/CDの改善の奮闘
mbook
0
820
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
9
620
Gamification - CAS2011
davidbonilla
81
5.5k
Scaling GitHub
holman
463
140k
Building a Scalable Design System with Sketch
lauravandoore
463
33k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.1k
Rails Girls Zürich Keynote
gr2m
95
14k
Facilitating Awesome Meetings
lara
56
6.6k
The World Runs on Bad Software
bkeepers
PRO
72
11k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
980
Six Lessons from altMBA
skipperchong
29
4k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
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