I want to setup a small event sourcing lib. I read a few tutorials online, everything understood so far.
The only problem is, in these different tutorials, there are
I read about an event-sourcing approach that consists in:
base on you use cases either:
a. creates and registry on aggregate table, generating an ID, version = 0 and a event type and create an event on event table;
b. retrieve from aggregate table, events by ID or event type, apply business cases and then update aggregate table (version and event type) and then create an event on event table.
although I this approach updates some fields on aggregate table, it leaves event table as append only and improves performace as you have the latest version of an aggregate in aggregate table.