Skip to content

Compaction filters #159

@iczero

Description

@iczero

Is your feature request related to a problem? Please describe.
Sometimes it is desired to have expiration for items in the database. For example, a session store where sessions expire, or a cache with simple expiry times. In such cases, deletion is not required to happen immediately, but it is still preferred to eventually get rid of the expired or stale data at some point.

Describe the solution you'd like
RocksDB allows the user to specify a compaction filter, but I am not sure if this idea would work in Fjall. The compaction filter can exclude k/v pairs during compaction, therefore deleting them.

Alternatively something else that can efficiently accomplish the same.

Describe alternatives you've considered

  • Delete expired values when reading: works (and would be required even if such a feature were implemented) but requires a value to be read before it can be deleted. Stale values will still get compacted, which might be a waste of resources.
  • Periodically scan the keyspace and delete expired values: requires scanning entire keyspace, probably less efficient than compaction filter.

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions