Skip to content

Configuration

FileDB is configured by CLI flags, an optional YAML file, and a few environment variables. CLI flags always win over the config file.

Terminal window
filedb serve \
--data ./data \
--api-key my-secret-key \
--grpc-addr :5433 \
--rest-addr :8080

Or via a config file:

Terminal window
filedb serve --config filedb.yaml

See the fully commented filedb.example.yaml.

FlagDefaultDescription
--data./dataData directory.
--grpc-addr:5433TCP gRPC listen address.
--rest-addr:8080REST gateway listen address.
--socket/tmp/filedb.sockUnix domain socket path.
--api-key$FILEDB_API_KEYAPI key (empty = no auth).
--metrics-addr:9090Prometheus metrics address (empty = disabled).
--segment-size4194304Max segment file size in bytes (4 MiB).
--compact-interval5mCompaction interval.
--compact-dirty0.30Dirty-ratio threshold to trigger compaction.
--syncnoneDurability mode: none, always, or interval.
--sync-interval1sFlush cadence when --sync=interval.
--tx-timeout5mIdle timeout before an open transaction is reaped (0 = off).
--default-ttl0Default expiry for inserted records (0 = never), e.g. 24h.
--watch-buffer64Per-subscriber Watch buffer; overflow signals a slow subscriber.
FlagDescription
--tls-cert / --tls-keySecure the TCP gRPC listener with a cert/key pair.
--tls-client-caPEM CA bundle that signs trusted client certs (enables mTLS).
--tls-client-authClient-cert policy: off, require, or verify-if-given.

Scoped API keys — configure multiple named keys with read or read-write scope. A read-only key is refused on writes, and keys hot-reload on SIGHUP for rotation without a restart.

FlagDescription
--log-leveldebug, info, warn, or error.
--log-formattext or json.
--audit-logAppend-only NDJSON audit file of mutating/admin RPCs and auth failures.
--slow-query-msLog any Find slower than N ms at WARN, with scan stats (0 = off).
--max-inflightServer-wide in-flight RPC ceiling; excess gets RESOURCE_EXHAUSTED (0 = off).
--rate-limitPer-API-key rate limit (req/s); over-budget gets RESOURCE_EXHAUSTED (0 = off).
--max-concurrent-streamsMax HTTP/2 streams per gRPC connection (0 = library default).
--otlp-endpointOTLP/gRPC collector for OpenTelemetry tracing (empty = off).
--otlp-sample-ratioTrace sampling ratio.
  • gRPC grpc.health.v1.Health (SERVINGNOT_SERVING on graceful shutdown).
  • HTTP /healthz (liveness) and /readyz (DB open + data dir writable).