Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
460
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 (Laravel Live Denmark)
freekmurze
0
160
I shall define this only once
freekmurze
0
350
An Introduction to Snapshot testing
freekmurze
0
440
Event Sourcing In Laravel
freekmurze
0
210
Building a realtime dashboard with Laravel Livewire (PHPKonf)
freekmurze
0
740
A tour behind the scenes of Oh Dear (PHP Benelux)
freekmurze
2
790
A practical look at multitenancy in Laravel
freekmurze
1
310
A practical look at multitenancy in Laravel (Laracon US)
freekmurze
0
680
Highlights Flare codebase (Laracon online)
freekmurze
0
430
Other Decks in Programming
See All in Programming
React への依存を最小にするフロントエンド設計
takonda
21
8.3k
14 Years of iOS: Lessons and Key Points
seyfoyun
0
360
Micro Frontends Unmasked Opportunities, Challenges, Alternatives
manfredsteyer
PRO
0
180
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
400
watsonx.ai Dojo #4 生成AIを使ったアプリ開発、応用編
oniak3ibm
PRO
1
260
[Do iOS '24] Ship your app on a Friday...and enjoy your weekend!
polpielladev
0
200
.NET のための通信フレームワーク MagicOnion 入門 / Introduction to MagicOnion
mayuki
1
2.8k
Contemporary Test Cases
maaretp
0
150
Vapor Revolution
kazupon
2
2.4k
カンファレンスの「アレ」Webでなんとかしませんか? / Conference “thing” Why don't you do something about it on the Web?
dero1to
1
150
AWS AppSyncを用いた GraphQL APIの開発について - NIFTY Tech Talk #22
niftycorp
PRO
0
100
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
9
4k
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Building Adaptive Systems
keathley
38
2.3k
Building Applications with DynamoDB
mza
90
6.1k
Facilitating Awesome Meetings
lara
50
6.1k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Faster Mobile Websites
deanohume
305
30k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
How to Ace a Technical Interview
jacobian
276
23k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
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