Connecting from Applications: Overview

Stable

Recommendations for drivers, pooling, timeouts, retries, and secrets when connecting through Gateway.

Updated: March 5, 2026

The recommended way for applications to connect to SPG99.

  • Drivers: use standard PostgreSQL drivers (node-postgres, libpq, JDBC, psycopg, and so on). No forks are required.
  • Pooling: for long-lived services, use a connection pool on the application side or in your framework.
  • Serverless / jobs: create a connection per request or per job, then close it. Make sure the first connection supports retry with backoff.
  • Timeouts: keep connect_timeout in the 5–10s range; the first attempt after idle may hit a cold start, so it is important to retry correctly.
  • Secrets: store the API key separately from pg_user / pg_password. Only database credentials should be present in the application DSN.
  • TLS: use sslmode=require at minimum; for stricter certificate validation, use verify-full.

The main practical idea is simple: your application should treat SPG99 as a regular PostgreSQL endpoint, while still being ready for a normal cold start after idle.