> For the complete documentation index, see [llms.txt](https://mode-development.gitbook.io/atomcombat/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mode-development.gitbook.io/atomcombat/getting-started/storage.md).

# Storage (YAML, SQLite, MySQL)

Bounties and combat stats are the only two modules with persisted data, and they share the same storage backend, configured once in the main `config.yml`:

```yaml
storage:
  type: yaml
  table-prefix: atomcombat_
  sqlite:
    file: data/atomcombat.db
  mysql:
    host: localhost
    port: 3306
    database: atomcombat
    username: root
    password: ''
    pool-size: 10
```

## `type: yaml` (default)

No setup required. Each module keeps its own flat file under `plugins/AtomCombat/data/` (configurable per module, e.g. `storage.file` in `modules/bounties.yml`). Writes are atomic (written to a temp file, then moved into place) so a crash mid-write can't corrupt your data.

Best for a single small-to-medium server.

## `type: sqlite`

Stores everything in one local database file (`storage.sqlite.file`, relative to the plugin data folder). Still local to this server, but avoids YAML's full-file-rewrite pattern and scales better with large bounty/stat histories.

## `type: mysql`

Points AtomCombat at a shared MySQL database (`storage.mysql.*`). Use this if you run a network of survival servers and want a single leaderboard and a single bounty board shared across all of them. Connections are pooled with HikariCP; `pool-size` caps how many connections AtomCombat opens.

`table-prefix` lets AtomCombat share a database with other plugins without table name collisions — it creates `<prefix>bounties` and `<prefix>stats`.

## Switching backends

Switching `storage.type` and reloading (or restarting) starts AtomCombat reading and writing through the new backend immediately. AtomCombat does **not** automatically migrate existing data between backends — export/import between YAML and SQL is a manual step if you need to carry old data over.

If AtomCombat cannot connect to the configured SQLite or MySQL database at startup, it logs a warning and falls back to YAML storage for that run rather than failing to start.


---

# 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://mode-development.gitbook.io/atomcombat/getting-started/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.
