Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Event Sourcing In Laravel

Event Sourcing In Laravel

A1b4b398630bbd32b77a82cbc37fae9a?s=128

Freek Van der Herten

January 19, 2021
Tweet

Transcript

  1. Event Sourcing 
 in Laravel

  2. About me Freek Van der Herten @freekmurze spatie.be freek.dev ohdear.app

    f l areapp.io
  3. Open Source 
 Software

  4. spatie.be/open-source

  5. spatie.be/videos

  6. Let's talk about event sourcing

  7. Talk overview Theory Projectors demo Aggregates demo

  8. Traditional application Write data in database An update means overwriting

    the old data The old data cannot be accessed anymore
  9. APPLICATION DATABASE TABLE value X

  10. APPLICATION DATABASE TABLE value X value Y

  11. Event Sourced Application The application will f i re o

    f f events Events will get written in a dedicated store Events are passed to consumers that create projections Aggregate, Aggregate Root...
  12. APP EVENTS Event Event 1

  13. APP EVENTS Event Event 1 Event 2

  14. APP EVENTS Event Event 1 Event 2 Event 3

  15. APP CONSUMER EVENTS PROJECTION Event Event 1 Event 2 Event

    3
  16. APP CONSUMER CONSUMER 2 EVENTS PROJECTION Event Event 1 Event

    2 Event 3 ANOTHER PROJECTION
  17. APP CONSUMER CONSUMER 2 EVENTS PROJECTION Event Event 1 Event

    2 Event 3 ANOTHER PROJECTION
  18. APP CONSUMER CONSUMER 2 EVENTS PROJECTION Event Event 1 Event

    2 Event 3 Event 4 ANOTHER PROJECTION
  19. Event Sourced Application Auditing requirements Extra reports needed Recording the

    unhappy path There is some setup required
  20. Laravel 
 Event Sourcing

  21. Laravel Event Sourcing Package made by Spatie Aggregates, Projectors &

    Reactors Beautifully integrated into Laravel Easy to get started with
  22. Demo

  23. Aggregates

  24. None
  25. None
  26. None
  27. None
  28. None
  29. None
  30. Demo

  31. Wrapping up

  32. spatie.be/docs/laravel-event-sourcing

  33. Packages spatie.be/docs/laravel-event-sourcing eventsauce.io

  34. Event sourcing makes the easy things harder… …and the harder

    things easier — Frank De Jonge
  35. Course eventsourcery.com

  36. Larabank github.com/spatie/larabank-traditional github.com/spatie/larabank-event-projector github.com/spatie/larabank-event-projector-aggregates

  37. One more thing

  38. spatie.be/event-sourcing The basics of event sourcing Best practices Laravel speci

    f i c examples Event sourced cart ETA July 2021
  39. Thank you! spatie.be/docs/laravel-event-sourcing spatie.be/products (only this week 25 % discount

    on everything) ohdear.app