Closed npezza93 closed 1 month ago
testing this on prod and its working like a charm
Awesome. Wonder if we should gel the domain language around trimming vs pruning?
@djmb Could you have a look?
Awesome. Wonder if we should gel the domain language around trimming vs pruning?
I've renamed everything from prune to trim. Is that what you mean?
Ah great. Yes 👍
@npezza93 what do you think about triggering the trimming according to send activity, rather than unsubscribes? Could trigger a trim every n messages (by keeping a counter, or just using a random check on each write that's weighted according to that n, which will average out to the same thing).
That way the trimming workload would be balanced with the write workload, rather than being dependent on how often clients unsubscribe. Which I think should better match the work that trimming has to do -- the more messages you send, the more of them you'll have to trim.
I'd recommend a random check rather than a counter - you don't need to store the counter state, and you avoid a thundering herd from a bunch of processes booted together.
Fixes #10