So the other day I was thinking to myself I wanted to know a bit more about event sourcing (ES) and the Command Query Responsibility Segregation pattern (CQRS). I have used ES before in a project before but I used library which was’t made by me. This gave me knowledge on how to model a domain using events but it didn’t give me the “down to the iron” experience of it. So I thought, what better way to learn about ES than by implementing a ES library myself.
In preparation, I started by watching the mandatory Greg Young 6 hour video on CQRS. I definitely recommend this video if you have time and want to learn more about ES/CQRS. I also read Martin Fowler introduction to Event Sourcing. The article “How we got rid of the database” by Gabriel Schenker is also quite interesting and gives a good idea on ES/CQRS works.
Ultimately I also drew lots of the inspiration from the Chapter on Aggregates and Event Sourcing from the “Implementing Domain-Driven Design” by Vaughn Vernon (this book is awesome, so check it out if you are into DDD or want to start using DDD).
The result is diyes. Its only in its first steps and it is only possible to save and load events in an in memory store. I hope to put some more effort into it as I get into other more interesting topics, as aggregates construction and snapshoting and of course the whole CQRS pattern.
As I go along I will probably share here most of my thoughts and ideas about it so if you are into ES/CQRS keep an eye.