Does anyone have any views on the best way to approach creating projections that aggregate based on time?
For example say I have events being stored for each visit to a url. How can I write a projection that enables plotting the number of visits per unit time say 5 mins?
Do I create a projection that holds an ever expanding array of 5 minute counts? or as a flavor of this create a stream of events (say one event per day) which contain an array of the 5 min values? I would have to deal with the present (would need to hold off emitting an event until a 5 min window is complete).
Do I create a new stream for each 5 min period and then one to reduce them into a single projection?
Is it an option to persist a timing event every 5 seconds and aggregate all events between timing events?
Cheers
Matt