About me
Freek Van der Herten
Partner & developer at Spatie
@freekmurze
https://murze.be
https://ohdear.app
Slide 3
Slide 3 text
Spatie
Since 2003
Websites, applications and webshops
Team
9 awesome human beings
Specialisation
Laravel, front-end development
Slide 4
Slide 4 text
Open Source
Software
Slide 5
Slide 5 text
We create a lot of it
± 200 packages on Packagist
± 2,000,000 downloads a month
± 25,000,000 total downloads
All Postcardware!
Slide 6
Slide 6 text
Highlights
Popular
laravel-backup
laravel-medialibrary
laravel-permission
New
laravel-query-builder
laravel-blade-x
Slide 7
Slide 7 text
https://spatie.be/open-source
Slide 8
Slide 8 text
https://spatie.be/open-source/postcards
Slide 9
Slide 9 text
Let's talk about
event sourcing
Slide 10
Slide 10 text
Talk overview
Projecting events in short
Laravel Event Projector demo
Eventsauce demo
Slide 11
Slide 11 text
Event Sourcing
in short
Slide 12
Slide 12 text
Traditional application
Write data in database
An update means overwriting the old data
The old data cannot be accessed anymore
Slide 13
Slide 13 text
APPLICATION
DATABASE
TABLE
value X
Slide 14
Slide 14 text
APPLICATION
DATABASE
TABLE
value X
value Y
Slide 15
Slide 15 text
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...
Event Sourced Application
Auditing requirements
Extra reports needed
Recording the unhappy path
There is some setup required
Slide 24
Slide 24 text
Laravel
Event Projector
Slide 25
Slide 25 text
Laravel Event Projector
Package made by Spatie
It's not full event sourcing, it focuses on projections
Beautifully integrated into Laravel
Easy to get started with
Slide 26
Slide 26 text
https://docs.spatie.be/laravel-event-projector
Slide 27
Slide 27 text
Demo
Slide 28
Slide 28 text
Eventsauce
Slide 29
Slide 29 text
Eventsauce
Package made by Frank De Jonge
Focuses on aggregates
Framework agnostic
Separate Laravel bindings package available
Very powerful, adds complexity
Slide 30
Slide 30 text
https://eventsauce.io/docs/
Slide 31
Slide 31 text
APP
Subtract $1000
Slide 32
Slide 32 text
AGGREGATE ROOT REPOSITORY
UUID PAYLOAD TIME
APP
Subtract $1000
Summary
Laravel Event Projector
Easy to use package to get started with projections
Hooks into Laravel's native events
Replay capabilities
No aggregates
Slide 42
Slide 42 text
Summary
EventSauce
Framework agnostic
Support for aggregates, process modelling
No replay capabilities out of the box
https://github.com/spatie/laravel-eventsauce
Slide 43
Slide 43 text
Writes are harder, reads are easier
Slide 44
Slide 44 text
Event sourcing makes the easy things harder…
…and the harder things easier
— Frank De Jonge