> For the complete documentation index, see [llms.txt](https://wiki.ree6.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.ree6.de/database/h2-as-a-server.md).

# H2 as a Server

## Why?

Well if you want to use the Bot and the Backend at the same time, using only H2 or SQLite won't work! Since they lock the file on every read-and-write operation. So if you use H2 you can enable the option called `createEmbeddedServer` which allows you to create a small H2 Database Server that handles all incoming requests for anything Database related!

### Setup

To start you will need to set the value `hikari.misc.createEmbeddedServer` to true and set the storage to h2. Once you do so only other thing you need to do is set the same port on the Backend and set the host to the IP of the Bot. After setting all these values the last thing to do is set the storage type to h2-server on the Backend and it should connect to the H2 Server running on the


---

# 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 dynamically by asking a question.

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

```
GET https://wiki.ree6.de/database/h2-as-a-server.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.
