Probably a silly question but how would you model basic counters?
Let’s say I have basket-N and I need N to start from 0 and be sequential.
I did it using a counter stream with ‘IncrementedCounter’ event (which I assume is more like ‘CreatedNewBasketId’ event) and now I just count up the events and that’s how I know that there are that many baskets and I can look for any basket within that counter and it should be there.
This seems ok but a bit smelly.
I guess I could also store actual incremented Id in every ‘CreatedNewBasketId’ and that gives it a bit more flexibility for processing and in case Ids need to be more than just a sequence of numbers.
So, what’s a proper way of doing something like that (don’t do it in ES at all and use SQL? ?