On-demand database
PostgreSQL that runs only when it is needed
On-demand databases scale compute with load and pause when no one is connected. Create one with a single API request.
Built for workloads that come and go
Every on-demand database is standard PostgreSQL, so your drivers, ORMs, and tools work without changes.
Automatic scaling
Compute grows with load and shrinks when traffic drops, within a range you set.
No compute charges while paused
A paused database incurs storage charges only.
Wake on connect
The next connection resumes a paused database. No API call or console action is needed.
Safe to automate
Agents create databases through the API, and an idempotency key turns a retry into a no-op.
Scoped credentials
Give each agent its own role with only the permissions its task requires and an expiration time.
Encrypted connections
Every connection uses TLS with a publicly trusted certificate and supports sslmode=verify-full.
How pausing and resuming works
A database moves between two states on its own.
- Running
About 10 minutes without connections
A new connection, ready in about 7 seconds
- Paused
- Set your client's connect timeout to at least 15 seconds so the first connection after a pause succeeds.
- Close idle connections in your application's pool. Any open connection keeps the database running.
- Turn off Pause when idle for a database that should stay running.
Specifications
- Compute
- 0.5–14 CU, depending on the region. 1 CU is about 1 vCPU and 2 GB of memory.
- Default range
- 0.5–2 CU
- Storage
- 20–1,000 GB, in 5 GB steps
- PostgreSQL
- Versions 17 and 18
- Connections
- Direct, on port 5432
- Grantable roles
- owner, pg_monitor, pg_signal_backend
- Regions
- cn-hangzhou (Hangzhou), ap-east-1 (Hong Kong), ap-southeast-1 (Singapore), eu-central-1 (Frankfurt), us-east-1 (Virginia)
- Pricing
- $0.09 per CU-hour; storage $0.375 per GB-month
Common uses
On-demand databases suit workloads that are idle more often than they are busy.
A database per agent
Keep each agent's data separate, so one agent's mistake cannot affect another.
Task databases
Create a database for a single task and delete it when the task is done.
Preview environments
Give every branch its own database that sleeps when no one is reviewing it.
Development and testing
Test against real PostgreSQL without paying for compute while the database sits idle overnight.
Need a database that is always ready?
Always-on databases run on dedicated resources with high availability, connection pooling, and backups.
Learn more
Create the first database for your agents
Sign up and create an API token to begin.