MicroStream Reference Manual
MicroStream HomeAPI Docs
2.2
2.2
  • Preface
  • System Requirements
  • License
  • Changelog
  • Installation
  • Data-Store
    • Overview
    • Getting Started
    • Root Instances
    • Configuration
      • Properties
      • Storage Files and Directories
      • Using Channels
      • Housekeeping
      • Backup
      • Lock File
    • Storing Data
      • Convenience Methods and Explicit Storing (Transactions)
      • Lazy and Eager Storing
      • Transient Fields
      • Best Practice
    • Loading Data
      • Lazy Loading
        • Touched Timestamp, Null-Safe Variant
        • Clearing Lazy References
    • Deleting Data
    • Queries
    • Application Life-Cycle
    • Legacy Type Mapping
      • User Interaction
    • Backup Strategies
    • Import / Export
    • Housekeeping
    • FAQ
      • Data Model
      • Data Management
      • File Storage
      • Environment
      • Miscellaneous
    • Customizing
      • Custom Type Handler
      • Custom Legacy Type Handler
      • PersistenceEagerStoringFieldEvaluator
  • Basic Concepts
    • Layered Entities
      • Configuration
      • Defining Entities
      • Creating Entities
      • Updating Entities
      • Versioning
      • Logging
      • Multiple Layers
    • Wrapping
      • Configuration
      • Usage
Powered by GitBook
On this page
  • Intervall and Time Budget
  • File Sizes and Payload
  • Cache
Export as PDF
  1. Data-Store
  2. Configuration

Housekeeping

PreviousUsing ChannelsNextBackup

Last updated 3 years ago

This is the manual for older MicroStream versions (Version < 5.0).

The new documentation (Version >= 5.0) is located at:

Intervall and Time Budget

interval and time budget is configured by setting up a StorageHousekeepingController.

Available properties are:

  • interval the housekeeping is triggered in milliseconds, default once per every second

  • time budget for housekeeping in nanoseconds, default is 0.01 seconds

EmbeddedStorageManager storage = EmbeddedStorage.Foundation(
	Storage.ConfigurationBuilder()
		.setHousekeepingController(Storage.HousekeepingController(1000, 10_000_000))
		.createConfiguration())
	.start();

File Sizes and Payload

The desired file min and max sizes and payload ratio is configured by the StorageDataFileEvaluator:

available properties are:

  • Data file minimum size Files smaller then minimum file size will be merged with other files if possible, default is 1 MB.

  • Data file maximum size Files larger then maximum file size will be split in smaller ones, default is 8 MB.

EmbeddedStorageManager storage = EmbeddedStorage.Foundation(
	Storage.ConfigurationBuilder()
		.setFileEvaluator(Storage.DataFileEvaluator(1024*1024, 1024*1024*8, 0.75))
		.createConfiguration())
	.start();

Cache

The lifetime of objects in the internal entity cache can be configured by the StorageEntityCacheEvaluator:

Available properties are:

  • Entity cache threshold

    Abstract threshold value, roughly comparable to size in bytes with a time component, at which a cache must be cleared of some entities. Default is 1000000000.

  • Entity cache timeout Time in milliseconds after that an entity is considered to be old if not read meanwhile. must be greater zero, default is 86400000ms (1 day).

EmbeddedStorageManager storage = EmbeddedStorage.Foundation(
	Storage.ConfigurationBuilder()
		.setEntityCacheEvaluator(Storage.EntityCacheEvaluator(
			86_400_000, 
			1_000_000_000))
		.createConfiguration())
	.start();

Data file payload min ratio to trigger file refactoring, default is 0.75 (75%).

For external configuration see:

Properties
https://docs.microstream.one/
Housekeeping
House keeping interval
House keeping budget
Data file dissolve ratio