Hubmakerlabs / replicatr

Nostr relay with Internet Computer integration for inter-relay synchronization
https://mleku.dev/git/replicatr
GNU General Public License v2.0
13 stars 1 forks source link

inbound reference counting for avoiding pruning relevant events #38

Open mleku opened 3 months ago

mleku commented 3 months ago

making a note for future reference of a possible feature addition

the central idea is adding a new index that adds a reference count to events so that it can be seen how many events are referring to another event... this would probably need to be some kind of weighted and complex score, so that it not only evaluates the direct references, which will be replies, but also, the number of indirect references, to provide a weighting to evaluate whether an event should be evicted preferentially to others of similar age in terms of how recently they are accessed

currently the prune strategy purely is based on Least Recently Used LRU style, but a relevance score like this could help avoid pruning out data that has high relevance