Event-sourcing is akin to tidying up.
A well-organized event-sourced system is not unlike a library with its Dewey Decimal System, where everything is filed away precisely and able to be recalled at a moment’s notice.
A poorly-designed event-sourced system, on the other hand, is like a hoarder’s house. Piles and piles of unorganized stuff lying around everywhere. Very little of value can be found. And only after a lot of searching.
Some people are good at organizing information. Librarians curate their collections. They know what items are interesting, in demand, or otherwise valuable, and would make good additions.
Yet others blindly collect every little scrap of information.
Think of event-sourcing as a process of tidying up your data collection. Declutter and organize.
Here is my decluttering method, inspired by the Konmari Method.
Commit yourself to tidying up
It takes mental fortitude to bring order to chaos. Recognize that your patience will be challenged and commit yourself to going through the process.
Visualize your ideal workflows
Inevitably during the process of tidying up, you will find that the workflows you are describing could be simplified or improved. Take the time you need to visualize what the ideal workflows should look like.
Finish discarding first
Remove anything not related to the domain you are modeling.
Tidy by category, not location
Group events into categories by responsibility. For example, everything related to customer accounts should go to one place and everything related to shopping carts should go to a separate group.
Ask yourself if it offers insight
Come up with at least one example of how this piece of data could offer insight into customer behavior. If you can’t think of one, consider not storing it.
Event-sourcing is about simplifying and discarding what’s not necessary, not about hoarding. And you might even find a spark of joy in it.
Have any questions or comments about this post? Email me at email@example.com
Get Daily Event-Sourcing Tips
I send out a short email each weekday with code snippets, tools, techniques, and interesting stuff about event-sourcing.