# Storage Targets

{% hint style="warning" %}
**This is the manual for older MicroStream versions (Version < 5.0).**

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

[https://docs.microstream.one/](https://docs.microstream.one/manual)
{% endhint %}

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.

![](/files/-MIKYyQ_UBy7JqyeHwFr)

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.

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

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

```java
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.

```markup
<!-- 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>

```

```java
// 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"));

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://manual.docs.microstream.one/data-store/storage-targets.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
