I created a projection merging three $ce-* streams together. It’s been populating for a day and a half. At one time it got to 90 something %, and then jumped back down. In addition, every one of our other projections is also below 100%. The end of the day, our system is basically unusable. At least it was over a weekend, but the weekend is coming to a close.
Questions:
Why are the other projections also populating?
Why does it take so long (we’ve done this a few times in the past. Every time it gets worse and worse, from a few hours to a half a day, and now coming close to two days…obviously has much to do with the amount of events we have.
Are we doing something wrong with eventstore? Should we be using the $all stream instead?
Unfortunately, the projection will have to go through each event, from category, and then link it to your new stream, which I am guessing is the root of your problem.
If I was managing this, I would look at reorganing the streams a little to make concurrent processing possible.
For example. is there a common Id that relates the four streams (maybe the donor?)
Using this technique, I would build a stream per relationship:
linkTo(‘pledge-reporting-’, event)
This means if you need to build one big stream, you could do it concurrently by using foreachStream.
Alternatively, could correlationId do this free of charge?
I don’t think so, but could you run a test, and just see how long it takes query to process the events, to see if the linkTo is the source of the delay:
$any : function(s,e){
return { count :0 }
},
$any: (state, event) => {
//Is there anything you can filter out?
s.count++; //see how it takes to count all your events
}
})
If that takes just as long, I guess it means you can’t avoid this.
The CorrelationId is a system projection, so I think that gets processed as a C#, rather than javascript, which might be faster than what you are trying.