- A subset of our Event Store streams only need to store the last n events in them. We’ve been told we can write a projection that writes metadata to [some category name] streams to achieve this
- I’m guessing this is a fairly standard requirement but we haven’t any experience with custom projections.
- We currently enable a single system projection and have no custom projections running.
Could anyone point us towards what such a projection would look like please?
(we’re trying to alter the metadata for all streams in a particular category - and set the maxCount (or maxAge) for these streams)
- Am I correct in understanding that the maxCount metadata is actually applied to the stream (and events truncated) only when scavenging?
- Are there any operational concerns we should be considering when we enable this custom projection? (apart from monitoring the projection state via stats)
- I guess I could write the same metadata (in application code) when we initially create the stream - is this considered a better/safer approach to stay away from custom ES projections? (I’ve seen various issues/comments on this forum about custom projections causing issues).