I've just been trying to learn a bit more about CQRS and Event Sourcing.
Looking through examples, and blogs, I see a lot of example event structures that are something like this
public class Event
{
public Guid AggregateId {get; set;}
public string Data {get; set;} //some serialized data
public int Version {get; set;}
}
and then the Aggregate
public class Aggregate
{
public Guid AggregateId {get; set;}
public string Name {get; set;}
public int Version {get; set;}
}
What I don't understand is what this version integer is for, and maybe my lack of the big picture understanding is why I can't seem to find an answer.
Is it simply a counter of what event we're on in ascending order? Is it actually a version of event, for like if you change the schema or something?
And same with Aggregates, when I look at different aggregates and I see one at version 1, and one at version 2, what exactly is that suppose to mean to me?