Don't worry, you are in good company. The answer might just be that you embrace the changing data and use an event store to code with the flow. At a recent Dallas PHP community meetup, I took the audience through a step-by-step build up of an event store built in a not-so-trivial Laravel application. Using the event store and the example code, you will have all you need to get started with event sourcing your data models.
Tap thumbnail to load video. Tap play icon once loaded to begin playing.
In the example application on Github, based on the automobile industry, you can manufacturer yourself a truck and register it with the DMV, storing all the changes as events along the way. Then you can read back the stream of events to recreate any moment-in-time representation of your truck. You can take snapshots of your event stream to optimize the event store, and re-insert events in time-sequence order. It is a playground to explore how event sourcing might be useful for your next application.
Good crowd for @dalabarge’s talk about event sourcing and events tonight!
— @dallasphp (May 9, 2018)
You should walk away learning:
- Work with Aggregates, Events, Streams, Snapshots, and Projections
- Create an event store table
- Project an event stream for a read model
- Optimize an event stream with snapshots
- Apply CQRS by using Commands and Queries
- Build a JSON endpoint to expose our projections
- Get all the source code to start event sourcing immediately
All the slides, code, and talking highlights are available: