Skip to main content
Reference

Storage

Persistence backends for the control plane: file system, PostgreSQL, and FoundationDB.

The control plane is stateful. Pick a backend by how many control plane nodes you run.

File system (RocksDB)PostgreSQLFoundationDB
NodesSingle node onlyMulti-nodeMulti-node
ScalabilityOne nodePrimary/replica failoverLinear horizontal scaling
Fault toleranceNonePrimary/replica failoverAutomatic recovery with no data loss
Suited toDevelopment, single-node production, air-gapped hostsLight-to-moderate multi-node workloadsBattle-tested at global scale
AvailabilityOpen sourceOpen sourceEnterprise

Multi-node deployments also need a pub/sub backend so nodes can coordinate. See Pub/sub below.

File system

RocksDB on the local disk. It is local to one node and cannot be shared, so it is the right choice for exactly one control plane instance and the wrong choice for two.

With no path set, the engine uses a platform default:

PlatformDefault path
Linux~/.local/share/rivet-engine/db
macOS~/Library/Application Support/rivet-engine/db
Windows%LOCALAPPDATA%\rivet-engine\db

In a container or as a service the path defaults to ./data/db, relative to the working directory. Always mount a volume at whatever path you choose.

PostgreSQL

The recommended backend for multi-node deployments. It is production-ready for light-to-moderate workloads, up to roughly 1,000 concurrent actors. Past that, or for high-throughput realtime workloads, contact enterprise support about FoundationDB.

Do not use a connection pooler

The engine needs direct connections for session-level features. PgBouncer, Supavisor, and AWS RDS Proxy are not supported. Where a managed provider offers both, use the direct connection string, not the pooled one.

TLS

Add sslmode to the connection URL:

ValueBehavior
disableNever use TLS
preferUse TLS if available (default)
requireRequire TLS, fail if unavailable

require encrypts the connection but does not verify the server certificate. To verify against a CA, or to authenticate with a client certificate, set the paths explicitly:

ParameterDescriptionPostgreSQL equivalent
root_cert_pathRoot certificate used to verify the serversslrootcert
client_cert_pathClient certificate for client authenticationsslcert
client_key_pathClient private key for client authenticationsslkey

All three are optional. Without them the engine uses the system root certificates.

Managed provider notes

FoundationDB

A distributed, ordered key-value store originally built by Apple, and the backend behind iCloud, Snowflake’s metadata layer, Datadog, and Tigris. Its strict serializability, fault tolerance, and linear scaling make it the right fit for large deployments.

FoundationDB requires an enterprise license. Cluster setup is handled during onboarding. Contact enterprise support to get started.

Pub/sub (NATS)

Multi-node deployments use NATS to coordinate realtime messaging between control plane nodes. Single-node deployments need no pub/sub configuration at all.

{
  "postgres": {
    "url": "postgresql://user:password@host:5432/database"
  },
  "nats": {
    "addresses": ["nats:4222"]
  }
}

Run at least two NATS replicas for high availability.

Next steps