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
  • Channel Usage
  • Channel Configuration
Export as PDF
  1. Data-Store
  2. Configuration

Using Channels

PreviousStorage Files and DirectoriesNextHousekeeping

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:

Channel Usage

are the IO threads used by the MicroStream storage engine. A single channel represents the unity of a thread, a storage directory and cached data. Increasing the number of channels means to run more IO threads.

The channel count is an important configuration value that impacts to IO performance.

Channel Configuration

For the channel configuration the following configuration are available:

  • Channel count

    The number of channels that MicroStream will use. Must be 2n2^n2n

  • Channel directory prefix

    The channel directory will be prefix+channelNumber e.g. "ch_0" if prefix is "ch_"

  • Data file prefix default is "channel_"

  • Data file suffix deflaut id ".dat"

Channel file size configuration is done by the the .

They can be set By storage.embedded.configuration API:



embeddedStorageManager storageManager = Configuration.Default()
	.setChannelCount(4)
	.setChannelDirectoryPrefix("channel_")
	.setDataFilePrefix("channel_")
	.setDataFileSuffix(".bin")
	.createEmbeddedStorageFoundation()
	.createEmbeddedStorageManager();
<properties>
	<property name="channelCount" value="4" />
	<property name="channelDirectoryPrefix" value="channel_" />
	<property name="dataFilePrefix value="channel_" />
	<property name="dataFileSuffix" value=".dat" />
</properties>
channelCount = 4
channelDirectoryPrefix = prefix
dataFilePrefix = channel_
dataFileSuffix = .dat

Or by setting a StorageFileProvider using theEmbeddedStorageFoundationfactory

EmbeddedStorageManager storage = EmbeddedStorage.Foundation(
	Storage.ConfigurationBuilder()
		.setChannelCountProvider(Storage.ChannelCountProvider(4))
		.setStorageFileProvider(StorageFileProvider.Builder()
			.setBaseDirectory("storage")
			.setChannelDirectoryPrefix("prefix")
			.setStorageFilePrefix("channel-")
        	.setStorageFileSuffix(".bin")
			.createFileProvider()).createConfiguration()
		).start();

See also:

https://docs.microstream.one/
properties
Configuration
Channels
Storage Data File Evaluator