﻿# schema configuration

config.schema — schema-extension log tuning.

<em>cyoda-go version <a href="https://github.com/Cyoda-platform/cyoda-go/releases/tag/v0.6.2">0.6.2</a></em>

# config.schema

## NAME

config.schema — schema-extension log tuning.

## SYNOPSIS

cyoda maintains a schema-extension log for tracking model schema changes over time. These
variables control savepoint frequency and retry behaviour when extending schemas on storage
backends.

## OPTIONS

- `CYODA_SCHEMA_SAVEPOINT_INTERVAL` — number of schema extensions between savepoint rows in
  the schema-extension log (default: `64`, minimum: `1`). Lower values increase write
  amplification but reduce recovery time after a crash.
- `CYODA_SCHEMA_EXTEND_MAX_RETRIES` — plugin-layer retry budget for `ExtendSchema` on
  backends that support native schema extension with optimistic concurrency
  (default: `8`, minimum: `1`). Increase if you observe contention under high concurrency.

## EXAMPLES

**High-write workload (more frequent savepoints):**

```
CYODA_SCHEMA_SAVEPOINT_INTERVAL=16
CYODA_SCHEMA_EXTEND_MAX_RETRIES=16
```

**Default:**

```
CYODA_SCHEMA_SAVEPOINT_INTERVAL=64
CYODA_SCHEMA_EXTEND_MAX_RETRIES=8
```

## SEE ALSO

- config
- models
- run

## See also

- [`cyoda help config`](/help/config/) — Environment variables beat default values. The `_FILE` suffix variant takes precedence over the plain variable when both are set — for example, `CYODA_POSTGRES_URL_FILE=/etc/secrets/db-url` wins over `CYODA_POSTGRES_URL`. There are no command-line flags for configuration values; env vars are the sole configuration surface.
- [`cyoda help models`](/help/models/) — A model is a named, versioned schema registered per tenant. Every entity in the system is an instance of exactly one model. Models are identified by `(entityName, modelVersion)`. The model ID is a deterministic UUID v5 derived from that key: `UUID.newSHA1(NameSpaceURL, "{entityName}.{modelVersion}")`.
- [`cyoda help run`](/help/run/) — cyoda-go is a single-process, multi-tenant REST and gRPC API server. It starts in serving mode when invoked with no subcommand. All configuration is via environment variables with a `CYODA_` prefix. The binary, Docker image, and Helm chart run the same binary; only the environment configuration differs across run modes.

## Raw formats

- [`/help/config/schema.json`](/help/config/schema.json) — full descriptor (matches `GET /help/{topic}` envelope)
- [`/help/config/schema.md`](/help/config/schema.md) — body only