# Databases

Sentinel uses up to three separate storage backends, depending on your deployment size. For evaluation or a small single-instance deployment, none of this needs any configuration.

## Zero-config default

On first start, Sentinel provisions its own embedded, SQLite-backed storage with no setup required — this is what [Install with Docker](/docs/sentinel/install/docker/) uses out of the box. It's a good fit for evaluation and small single-instance deployments. For production or clustered deployments, point Sentinel at networked backends instead.

## Main database

Stores configuration (Security Groups, API Keys), audit records, and other persistent state.

| Engine | Minimum version | Plan |
|---|---|---|
| SQLite | — | All (default, embedded) |
| LibSQL | 0+ | Professional, Enterprise |
| Turbolite | — | Professional, Enterprise |
| PostgreSQL | 15+ | Professional, Enterprise |
| MariaDB | 10.6+ | Professional, Enterprise |
| MySQL | 5.6+ | Professional, Enterprise |
| Microsoft SQL Server | 2022+ | Enterprise |
| Oracle | 21c+ | Enterprise |

All backends get automatic schema migrations, snapshots, and point-in-time recovery (PITR) — see [Backups & Recovery](/docs/sentinel/operations/backups-recovery/).

### Enabling an external main database

Set one environment variable — a connection string, on the variable name matching your engine. No separate "driver" or engine-selector variable is needed; the protocol prefix in the URL identifies the engine:

| Engine | Env var | Example |
|---|---|---|
| PostgreSQL | `POSTGRES_URL` | `postgresql://user:password@host:5432/altcha_sentinel` |
| MySQL | `MYSQL_URL` | `mysql://user:password@host:3306/altcha_sentinel` |
| MariaDB | `MARIADB_URL` | `mariadb://user:password@host:3306/altcha_sentinel` |
| Microsoft SQL Server | `MSSQL_URL` | `mssql://user:password@host:1433/altcha_sentinel` |
| Oracle | `ORACLE_URL` | `oracle://user:password@host:1521/ORCL` |
| LibSQL | `LIBSQL_URL` | `libsql://your-db.turso.io?authToken=...` |
| Turbolite | `TURBOLITE_URL` | `https://localhost/?bucket=my-bucket&prefix=main` |

For PostgreSQL, append `?sslmode=require` for TLS, or use `POSTGRES_TLS_CA` / `POSTGRES_TLS_CERT` / `POSTGRES_TLS_KEY` for a custom certificate — AWS RDS works out of the box since its CA bundle is included by default. Turbolite (S3-backed) also accepts `&encryptionKey=[32-byte-key]` on the URL, and needs no persistent volume since new instances recover data from object storage.

Leaving the variable unset keeps Sentinel on its embedded SQLite default.

## KV store

Used for shared state, rate limiting, distributed coordination, and pub/sub across instances — required once you run more than one replica. See [Clustering](/docs/sentinel/operations/clustering/).

- **Built-in KV store** — the default; no configuration required for a single instance.
- **Redis** 7+
- **Valkey** 7+

Sentinel only uses the Redis `string` data type and requires `EXPIRE [NX]` support, so any Redis-protocol-compatible service at version 7 or later works.

### Enabling an external Redis/Valkey

Set `REDIS_URL` to your instance's connection string, e.g. `redis://default@your-redis-host:6379`. For a Redis Cluster deployment, set `REDIS_CLUSTER_URL` to the cluster's configuration endpoint instead.

The built-in store itself is also configurable via `EXOTDB_REDIS_STORAGE`:

- `local` (default) — SQLite-backed, fine for a single instance.
- `memory` — in-memory, non-persistent.
- `turbolite` — S3-backed with built-in leader election, so it supports clustering without an external Redis; set `TURBOLITE_REDIS_URL` alongside it.

For a clustered deployment, either set `REDIS_URL` / `REDIS_CLUSTER_URL` to an external Redis/Valkey, or set `EXOTDB_REDIS_STORAGE=turbolite` with `TURBOLITE_REDIS_URL` to avoid running a separate Redis instance at all.

See [ENV Variables](/docs/sentinel/operations/env-variables/#kv-store-redis) for more details.

## Logs & analytics

Request logs and dashboard analytics are stored in the main database by default. For high-volume deployments, offload them to a dedicated backend instead:

- **[ClickHouse](/docs/sentinel/operations/clickhouse/)** 22.6+ (Enterprise plan) — see the dedicated page for the table schema and setup.

## Setting these on any deployment target

Every install method ultimately just sets environment variables on the Sentinel container — pick the one for your platform:

- **[Docker](/docs/sentinel/install/docker/)** — pass with `-e`, e.g. `-e POSTGRES_URL="..." -e REDIS_URL="..."`.
- **[Docker Compose](/docs/sentinel/install/docker-compose/)** — add them under the service's `environment:` block.
- **[Kubernetes](/docs/sentinel/install/kubernetes/)** — add them to the Helm chart's `env` list, either via `--set` or a `values.yaml` file.
- **[AWS ECS](/docs/sentinel/install/aws/#configuring-a-database)** — use the `DatabaseUrl` / `DatabaseUrlVarName` parameters for the main database, or the generic `ExtraEnvName`/`ExtraEnvValue` slots for `REDIS_URL` and anything else.
- **[Azure App Services](/docs/sentinel/install/azure/#configuring-a-database)** — add them under **Configuration → Application settings**.
- **[Bunny.net](/docs/sentinel/install/bunny/)** — add them as environment variables on the Magic Container.

## Choosing a backend

- **Evaluating Sentinel, or a single small instance** — stick with the embedded default; nothing to configure.
- **Production, single instance** — a networked main database (PostgreSQL is a common choice) for durability independent of the container's filesystem.
- **Multiple replicas / clustering** — a networked main database plus Redis or Valkey for the KV store. See [Clustering](/docs/sentinel/operations/clustering/).
- **High-volume logging** — add ClickHouse for logs/analytics so it doesn't compete with the main database for writes.

## Related

- **[Install with Docker](/docs/sentinel/install/docker/)** — setting the connection string on a single container.
- **[Install on AWS ECS](/docs/sentinel/install/aws/#configuring-a-database)** — `DatabaseUrl` / `DatabaseUrlVarName` parameters.
- **[Backups & Recovery](/docs/sentinel/operations/backups-recovery/)** — snapshots and point-in-time recovery.
- **[Clustering](/docs/sentinel/operations/clustering/)** — running multiple Sentinel instances against shared storage.
