I am heaving a hard time understanding what’s possible with continuous projections and what’s not.
The most simple problem I want to solve looks like this (all others problems are impossible to solve if this simple one isn’t possible):
- I have a million users.
- Each user writes his UI interactions into the stream
ui-{userId}
. - Let’s say there are (amongst others) the
EventType
sstart
andstop
inui-{userId}
.
No I want to create projections that result in the following behaviour:
- Each time a user
stop
s within 4 hours afterstart
ing an event is appended toleftearly-{userId}
.
Is this possible with a (or some) continuously running projections without creating a million projections (which I assume is not a good thing to do) and without a projection that has a state which contains all the last start
s for a million users?
And if this is possible (which I hope very much), how?
The way I see it, when a stop
is received by the projection the projection must somehow get access to the last start
event in the stream ui-{userId}
. But maybe I just don’t see the simple solution here.
Thanks in advance!