# Loading Data

{% 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 %}

Loading data can be done in two ways, eager and Lazy. The basic, default way of loading is eager loading. This means that all objects of a stored object graph are loaded immediately. This is done during startup of the MicroStream database instance automatically if an already existing database is found.

Contrary to [lazy loading](/data-store/loading-data/lazy-loading.md), eager loading has no requirements to your entity model.

To load your data you just need to create an `EmbeddedStorageManager` instance:

```java
EmbeddedStorageManager storage = EmbeddedStorage.start();
```

After that just get the root instance of your object graph from the `StorageManager` by calling `EmbeddedStorageManager.root()` and check for `null` as this indicates a non-existing database

```java
final EmbeddedStorageManager storage = EmbeddedStorage.start();

if(storage.root() == null)
{
    //No existing Database found
}
else
{    
    MyRoot root = (MyRoot) storage.root();          
}
```

{% hint style="info" %}
The full code for the eager loading example is on [GitHub](https://github.com/microstream-one/examples/tree/master/loading).
{% endhint %}


---

# 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/loading-data.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.
