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

Simplifying EventSourcing SFUGCGN 2024-07-04

Simplifying EventSourcing SFUGCGN 2024-07-04

Introduction into EventSourcing in PHP using the library patchlevel/event-sourcing. This talk exlcudes the reading side since on the event this was a separate talk held afterwards which was called "Exploring Projections and Processors in Event Sourcing" https://speakerdeck.com/davidbadura/exploring-projections-and-processors-in-event-sourcing-ca496e88-ea39-4fa5-97f1-62f110001de6.

Library: https://github.com/patchlevel/event-sourcing
Docs: https://event-sourcing.patchlevel.io/latest/

Symfony-Bundle: https://github.com/patchlevel/event-sourcing-bundle
Docs: https://event-sourcing-bundle.patchlevel.io/latest/

This Talk was held at the Symfony UserGroup in Cologne organized by QOSSMIC on the 4th of July 2024.

Daniel Badura

July 04, 2024
Tweet

More Decks by Daniel Badura

Other Decks in Programming

Transcript

  1. • Enables state recreation by replaying events • Provides historical

    data by design • Simplifies auditing • Facilitates new data views • Models system behavior with events, not states
  2. • Hotel Created • Guest Reserved Room • Guest Payed

    Reserved Room • Guest Checked In • Guest Checked Out
  3. • A Pattern from Domain-Driven-Design • An Aggregate is a

    cluster of multiple Domain objects • An Aggregate Root can be composed of multiple Aggregates • Every access should go through the Aggregate Root
  4. • Which Aggregate • When it happened • In which

    order it happened • And more information defined by the user
  5. • Is responsible for saving message in database • Everything

    happens transactional • Shipped Store is based on Doctrine DBAL • Own implementation possible