I am trying to learn Event Sourcing (using Greg Youngs Event Store) in my spare time. I have setup a simple stream and I can read from it and write to it.
Please see this link: https://eventstore.org/docs/getting-started/?tabs=tabid-1%2Ctabid-dotnet-client%2Ctabid-dotnet-client-connect%2Ctabid-4. It says:
"If you are Event Sourcing a domain model, a stream equates to an aggregate function."
I don't believe I have ever come across the term Aggregate Function before - I know aggregate root and aggregate, however not aggregate function. Say I have the events below:
BookingCreatedEvent
BookingUpdatedEvent
If I was to create an event log in SQL server then it could look something like this (the Cargo column contains the serialized object):
What Event streams would I have in Event Store for this? I was reading an answer from a user on here who seems to be very knowledgeable about Event Sourcing and he suggested the following:
AggregateType+AggregateId+Version
On that basis believe the events would be named as follows:
BookingCreatedEvent511 (51 is the aggregate ID and 1 is the version)
BookingUpdatedEvent511 (51 is the aggregate ID and 1 is the version)
BookingUpdatedEvent512 (51 is the aggregate ID and 2 is the version)
BookingCreatedEvent521 (52 is the aggregate ID and 1 is the version)
BookingUpdatedEvent513 (51 is the aggregate ID and 3 is the version)
BookingCreatedEvent531 (53 is the aggregate ID and 1 is the version)
BookingUpdatedEvent514 (51 is the aggregate ID and 4 is the version)
BookingUpdatedEvent515 (51 is the aggregate ID and 5 is the version)
BookingUpdatedEvent516 (51 is the aggregate ID and 6 is the version)
BookingUpdatedEvent517 (51 is the aggregate ID and 7 is the version)
Therefore there are 10 event streams. This looks a little confusing i.e. concatenating the aggregate ID and version - for example, say I had the following:
BookingUpdatedEvent51745
How would I know what part of 51745 is the aggregate ID and what part is the version.
Have I understood this correctly?