Neat article by Philippe Creux, Ruby and Rails developer at kickstarter, about implementation a minimal event sourcing framework at Kickstarter to power d.rip. Event Sourcing is to data what Git is to code. It’s simple and it has made their life so much better! Read on!
They start by observation of the Git and how Git is also a time machine, that allows you to go back in time and see what the code looked like back then: git checkout @{12.days.ago}.
User action, API calls, callbacks (webhooks), recurring cron jobs can all generate Events. Events are persisted and immutable. We know when they happened, who triggered them and what they were. By going through these events, we get a sense of what the current state of the world is and how it came to be in that state. It would be nice not to play all events every time we want to build application state.
They define four components that make a (minimal) Event Sourcing system: Events, Calculators, Aggregates and Reactors.
Article then dives in:
- Why Event Sourcing
- Events, Calculators, Aggregates, Reactors
- Dispatchers and Commands
- Event Sourcing for d.rip, how they went about the project
Code examples are also included. Great article!
[Read More]