# Managed Postgres

A step of the [Cloud application](https://gradus.kazet.blog/tree/cloud-application) tree on Gradus, in the Data & storage area: DB, cache, queues.

Page: https://gradus.kazet.blog/tree/cloud-application/step/db-postgres-provision

Provision a managed Postgres instance in the infrastructure code and connect the service to it through a pooled connection and a secret, with a local instance in a container for development.

One option of Database: Managed Postgres. The others: Document database.

Usually comes after: [Choose a database](https://gradus.kazet.blog/tree/cloud-application/step/choose-database).

Leads to: [Postgres migrations](https://gradus.kazet.blog/tree/cloud-application/step/db-postgres-migrations).

## Prompt for your AI assistant

```
Provision a managed Postgres instance for this service in the existing infrastructure code, sized for near-zero traffic, with the connection string stored as a secret the service reads at startup. Add a docker-compose file that runs a local Postgres for development, a database client with a connection pool in the service and a /health check that pings the database. Record the instance and the local setup in the database decision record.
```

Every step of the tree: https://gradus.kazet.blog/tree/cloud-application/llms.txt
