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

# Storage

InfinityRifts uses local YAML only. There is no SQLite, MySQL/MariaDB, PostgreSQL, Redis, JSON, connection pool, remote database, or database migration layer.

## Files

| File               | Purpose                          | Write behavior                                                                  |
| ------------------ | -------------------------------- | ------------------------------------------------------------------------------- |
| `config.yml`       | Main mapped settings             | Loaded then saved during construction; saved on reload                          |
| `gateways/*.yml`   | Gateway definitions              | Defaults copied only when missing; user files are read, not rewritten by loader |
| `active_rifts.yml` | Active gateway session snapshots | Written at shutdown; cleared after successful load into pending restorations    |

`active_rifts.yml` has this generated shape:

```yaml
rifts:
  - playerId: 00000000-0000-0000-0000-000000000000
    gatewayId: fire_gate
    currentWave: 2
    totalTimeRemaining: 120
    waveTimeRemaining: 45
    mobsRemaining: 3
    gatewayEndTimeMillis: 1780000000000
    waveEndTimeMillis: 1780000000000
    waveDurationSeconds: 60
```

Field names are Configurate-mapped Java names. The millisecond deadline fields were added for 1.10.0; restore retains legacy integer remaining-time fallback behavior.

## Save and restore lifecycle

There is no periodic database save. `GatewayManager.shutdown()` serializes active owner-backed gateways. At next enable, stored records are loaded into an in-memory pending-restoration map and the YAML list is cleared. When that player joins, restoration is scheduled 20 ticks later. Ownerless/random gateways are not represented by the player-keyed snapshot format.

## Backup and restore

Stop the server before copying `plugins/InfinityRifts/`. Back up all gateway definitions and `active_rifts.yml` together with the matching plugin version. To restore, stop the server, replace the data folder, verify gateway IDs referenced by `active_rifts.yml` still exist, and restart.

Malformed YAML logs `Failed to load active_rifts.yml`, `Failed to parse active rifts`, or a gateway/config load exception. The plugin falls back to an empty node/list; repair from backup before allowing new sessions to overwrite evidence.

Files are written with the server process's filesystem permissions. No credentials or secrets are required or stored.
