randomKeyIndex: RandomKeyIndex

A configurable property that can be optionally enabled for persistent create data types. Each Level can be configured to have unique configurations.

Configures storage for values within a persistent segment.


valuesConfig =
  ValuesConfig(
    compressDuplicateValues = true,
    compressDuplicateRangeValues = true,
    ioStrategy = ???, //see ioStrategy doc
    compression = ??? //see compressions doc
  )

compressDuplicateValues

If true, enables checks to ensure that duplicate non-range values are only stored once within a Segment.

compressDuplicateRangeValues

If true, enables checks to ensure that duplicate range-values are only stored once within a Segment.

Range values are created when using the range operations as documented in Remove data, Update data and Expire data and are mostly likely to have duplicates.

ioStrategy & compressions

See ioStrategy and compressions.

Why use this internal value compression over external compression like LZ4 or Snappy?

Because internal value compression entirely eliminates storing duplicate values including all meta-data (pointers, storage format etc) that might be required for that value.

External compression libraries generally do not compress small data well. For example if your values are Int, Double or Long values then LZ4 might not be as effective as the config compressDuplicateValues.