-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
kind/featureSomething completely new we should consider.Something completely new we should consider.
Description
I keep running into a form of this problem:
I want to expire items in the database based on custom logic. One such use case is when using badger as a disk-based cache, I don't want to expire items on a fixed schedule, but rather when free space gets low I want to start removing the coldest items. This is not very efficient because it requires walking the whole database and deleting items, and then triggering a compaction which will walk the whole database for a second time.
What if the condition (which is probably IsDeletedOrExpired() currently) were changed to a configurable function pointer that defaults to IsDeletedOrExpired(item)? Could something like that make sense?
Metadata
Metadata
Assignees
Labels
kind/featureSomething completely new we should consider.Something completely new we should consider.