MicroStream Reference Manual
MicroStream HomeAPI Docs
4.1
4.1
  • Preface
  • System Requirements
  • License
  • Changelog
  • Installation
  • Data-Store
    • Overview
    • Getting Started
    • Root Instances
    • Configuration
      • Properties
      • Storage Files and Directories
      • Using Channels
      • Housekeeping
      • Backup
        • Continuous Backup
        • Full Backup
      • Lock File
    • Storage Targets
      • Local File System
      • SQL Databases
        • MariaDB
        • MySQL
        • Oracle
        • PostgreSQL
        • SQLite
      • Blob Stores
        • AWS DynamoDB
        • AWS S3
        • Azure Storage
        • Hazelcast
        • Kafka
        • MongoDB
        • Oracle Cloud Object Storage
        • Oracle Coherence
        • Oracle NoSQL
        • Redis
    • 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
    • Import / Export
    • Housekeeping
    • Customizing
      • Custom Type Handler
      • Custom Legacy Type Handler
      • Custom Class Loader
      • Custom Storing Behavior
      • Optional Storage Manager Reference in Entities
    • REST Interface
      • Setup
      • REST API
      • Client GUI
    • FAQ
      • Data Model
      • Data Management
      • File Storage
      • Java Features
      • Miscellaneous
    • Addendum
      • Supported Java Features
      • Specialized Type Handlers
      • Examples and Demo Projects
  • Cache
    • Overview
    • Getting Started
    • Configuration
      • Properties
      • Storage
    • Use Cases
      • Hibernate Second Level Cache
      • Spring Cache
  • Basic Concepts
    • Layered Entities
      • Configuration
      • Defining Entities
      • Creating Entities
      • Updating Entities
      • Versioning
      • Logging
      • Multiple Layers
    • Wrapping
      • Configuration
      • Usage
Powered by GitBook
On this page
Export as PDF
  1. Data-Store

Storage Targets

PreviousLock FileNextLocal File System

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:

MicroStream supports a variety of storage targets. Through an abstracted file system (AFS), it is possible to connect to a lot of different back ends. The AFS allows to use folders and files, like in all common file systems, but with different connectors it is possible to use different solutions as the actual storage.

To connect to the local file system use the Java Non-Blocking IO (NIO) connector, which is part of the base module, so no additional dependency is needed.

EmbeddedStorage.start(Paths.get("path", "to", "storage"));

Internally this creates and uses a NioFileSystem and is a shortcut for:

NioFileSystem fileSystem = NioFileSystem.New();
EmbeddedStorage.start(fileSystem.ensureDirectoryPath("path", "to", "storage"));

The file system API is the same for all connectors, like for MySQL. This is part of another module.

<!-- sql file system -->
<dependency>
       <groupId>one.microstream</groupId>
       <artifactId>filesystem.sql</artifactId>
       <version>04.01.00-MS-GA</version>
</dependency>
<!-- driver of your choice -->
<dependency>
       <groupId>mysql</groupId>
       <artifactId>mysql-connector-java</artifactId>
       <version>8.0.21</version>
</dependency>
// create JDBC data source
MysqlDataSource dataSource = new MysqlDataSource();
dataSource.setUrl("jdbc:mysql://host:3306/mydb");
dataSource.setUser("user");
dataSource.setPassword("secret");

// create sql file system
SqlFileSystem fileSystem = SqlFileSystem.New(
     // use caching connector
     SqlConnector.Caching(
          SqlProviderMySql.New(dataSource)
     )
);

EmbeddedStorage.start(fileSystem.ensureDirectoryPath("path", "to", "storage"));

https://docs.microstream.one/