Managed databases
Create, bind, connect to, back up, and safely remove managed PostgreSQL and Redis resources.
Managed databases are first-class environment resources. They appear on the project canvas and use private networking for application traffic.
Create a database
- Select the intended environment.
- Choose Add Service → Database.
- Select PostgreSQL, Redis, or another available managed type.
- Review the version, resource class, storage behavior, and monthly quote.
- Confirm creation.
Agent-prepared deployments show the same resource in the Application Plan and require separate resource approval.
Bind an application
Prefer a resource binding over copying a credential. A source-connected repository can declare the desired topology:
services:
api:
run: node dist/api.js
port: 3000
resources:
customer-data:
type: postgresql
class: shared-small
bindings:
- source: resource.customer-data.connection_url
target: service.api.environment.DATABASE_URLAutodisc resolves the private connection URL and stores it in canonical
environment-variable storage. The value is not written to autodisc.yml, the
Change Request diff, model context, logs, or public events.
The repository file contains resource intent and named data flow, never the resolved credential. The generated Application Plan repeats the exact resource and binding for review before apply.
Application code should read the target variable:
const databaseUrl = process.env.DATABASE_URL;
if (!databaseUrl) throw new Error("DATABASE_URL is required");See Set up your repository for a complete portable database contract.
Migrations
Repository preparation may add migration files or a safe release command, but Autodisc does not authorize destructive production migrations implicitly.
Recommended flow:
- Commit migrations with the application revision.
- Test them against an isolated non-production database.
- Back up production before a destructive or irreversible migration.
- Run migrations once per release, not in every replicated application process.
- Keep schema rollback or forward-fix instructions with the release.
Connect from outside Autodisc
Use the connection information shown by the database node only when external access is supported and explicitly enabled. Applications inside the project should use the private hostname and port.
Deletion
Deleting a database can permanently remove its data. Stop application writes, take the required backup or export, and confirm that no environment binding still depends on it before deletion.