Skip to main content
Enable managed Postgres under deploy.addons:
squid.yaml
Supported versions are 14, 15, 16, 17, and 18. The current default is Postgres 18.
Do not make the indexer database the only copy of data that a blockchain replay cannot reconstruct. Standard Cloud Postgres is designed around reproducible indexer state. Contact SQD when you need additional backup, availability, or recovery requirements.

Connection variables

Cloud injects these variables into the init, processor, and api services:
  • DB_SSL
  • DB_HOST
  • DB_PORT
  • DB_NAME
  • DB_USER
  • DB_PASS
  • DB_URL
Cloud-provided values override variables with the same names from the manifest. Application code should normally consume DB_URL or the individual injected fields rather than defining its own production database credentials.

Database configuration

Timeouts accept an integer number of milliseconds or a value ending in us, ms, s, min, h, or d.
A larger timeout can hide a slow or blocking query. Inspect the query plan and locks before increasing it.

Direct access

Open the deployment’s DB access tab in the Cloud app to obtain a connection string for psql, a migration tool, or an external service. Limit external connections in the manifest:
max_connections accepts 0 through 100; plan-level limits may also apply. Use a small application pool and release connections promptly. Every named processor, API replica, and background job consumes database connections.

Compute and storage

Allowed profiles are small, medium, large, xlarge, and 2xlarge. See Pricing details for current allocations and rates. Storage values use G, Gi, T, or Ti. The default is 10Gi.
Storage growth can come from expected indexed data, indexes, dead tuples, or a query/backfill that creates excessive temporary data. Diagnose the cause before only raising the limit.
For tables that repeatedly update the same rows, follow Update-heavy tables. For historical schema work, follow Schema changes and backfills.

Transactions and background work

The Squid SDK processor normally writes each batch in a transaction. Do not run long, wall-clock-scheduled aggregates inside that transaction. Use a separate background processor service with:
  • its own database pool;
  • an explicit isolation level;
  • a statement timeout;
  • overlap protection;
  • Prometheus metrics.
When multiple chain processors write to the same tables, ensure they cannot update the same record concurrently. Separate processor state with unique state schemas and choose transaction isolation based on your consistency requirements.

Complete example

squid.yaml