> For the complete documentation index, see [llms.txt](https://docs.heisenware.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.heisenware.com/reference/functions/storage.md).

# Storage

The storage classes keep an App's data. Every workspace comes with a relational database, a timeseries database and a file store of its own, and the same classes also connect to database servers of your own.

## Which store do I need?

| What you have                                            | Where it belongs                                                                                          |
| -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| Rows that matter: orders, faults, inspections            | the [relational database](https://docs.heisenware.com/reference/functions/storage/relational-database.md) |
| Values over time: a signal recorded every few seconds    | the [timeseries database](https://docs.heisenware.com/reference/functions/storage/timeseries-database.md) |
| Photos, PDFs and other files a row points to             | the [file store](https://docs.heisenware.com/reference/functions/storage/files.md)                        |
| A bounded stream: the last 100 values, a window, a queue | a [buffer](https://docs.heisenware.com/reference/functions/storage/buffer.md)                             |
| A list of items the logic works on                       | a [data store](https://docs.heisenware.com/reference/functions/storage/data-store.md)                     |
| One record assembled from values that arrive separately  | an [accumulator](https://docs.heisenware.com/reference/functions/storage/accumulator.md)                  |

## Databases

The [relational database](https://docs.heisenware.com/reference/functions/storage/relational-database.md) class holds structured data in tables with relations between them. The workspace's own instance is called `internal-postgres`: a managed PostgreSQL that is there from the start, so you can drag its functions onto the Flowboard and store data at once. Its tables are the workspace's, shared by every App, and their shape is the **data model**, which you shape in the [Database editor](https://docs.heisenware.com/app-builder/app-builder/database-editor.md) or let the assistant shape.

The [timeseries database](https://docs.heisenware.com/reference/functions/storage/timeseries-database.md) class holds values over time. The workspace's own instance is called `internal-influx`. The quickest way to fill it is a [recorder](https://docs.heisenware.com/app-builder/app-builder/flowboard/recorder.md) on any output: it writes every value with no further configuration, and the timeseries functions read it back.

To use a server of your own instead, open the Functions explorer, pick the class and call its `create` function with your connection details. That makes a new instance beside the internal one. A database inside a private network needs an [agent](https://docs.heisenware.com/concepts/agents-and-where-code-runs.md) in that network, and the instance is created there.

{% hint style="info" %}
Whether you use the internal instance or your own server, the functions are the same.
{% endhint %}

## The file store

A row never holds a file's bytes and never a path. The bytes lie in the workspace's [file store](https://docs.heisenware.com/reference/functions/storage/files.md), and the row keeps an entry that says which file is meant. Upload and photo widgets deliver such entries by themselves; a flow hands over a file it produced with `Files.store`.

## In memory

For the working memory of your flows, data that lives in the running App and does not survive a restart, use these lightweight classes. Each holds one shape of memory and announces every change as an event, so a widget or a flow reacts the moment a value arrives, with no query and no polling:

* [Buffer](https://docs.heisenware.com/reference/functions/storage/buffer.md): a bounded stream, such as the last 100 values of a live chart, sliding and tumbling windows, queues.
* [Data store](https://docs.heisenware.com/reference/functions/storage/data-store.md): a list of items, addressable by index or by condition, shared between Apps by instance name.
* [Accumulator](https://docs.heisenware.com/reference/functions/storage/accumulator.md): one record assembled from values that arrive separately.

When data must survive a restart or be queried later, it belongs in a database. The in-memory classes are the step before it.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.heisenware.com/reference/functions/storage.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
