simerplaha / SwayDB

Persistent and in-memory key-value storage engine for JVM that scales on a single machine.
https://swaydb.simer.au
Apache License 2.0
293 stars 16 forks source link

Should refresh occur on Segments that were copied into lower Level during compaction? #299

Open simerplaha opened 3 years ago

simerplaha commented 3 years ago

Context

Each Level can have it own segment configuration with custom compression, fileSize, binarySearch, hashIndex, bloomFilter, compaction configurations etc.

Question

A Segment that does not have any overlapping key-values with lower level is copied to lower levels during compaction without performing any read IO.

Should these copied Segments refresh/re-create themselves with the configurations of the new Level?

Current solution

The default pre-configured data-types like Map use the same configuration for all Levels so the Segment refresh/re-create is disabled to save IO.