Hello Community!
Where are partitions stored? Only in RAM or maybe also on disk?
I have projection (simplified code below) which will produce hundreds of thousands partitions per month. And 99.99% of these partitions will no longer be needed because new events for these partitions will never come again. How to release resources (delete partitions) after few months of working? Should I just stop and start projection again? There is a “Cached Partitions” property which is set to zero when I stop and start projection. But the word “cached” bothers me that these aren’t all partitions.
fromStream("source-stream")
.partitionBy(function (event) { return event.data.CorrelationId; })
.when({
$init: function (state, event) { return { "startEvent": null } },
"EventA": function (state, event) {
state.startEvent = event;
},
"EventB": function (state, event) {
t1 = Date.parse(state.startEvent.data.PushTime);
t2 = Date.parse(event.data.PushTime);
emit("dest-stream", "IntervalEvent", {
intervalMs: t2 - t1
});
},
});