Create a database service

Task guide from Add service through first successful deploy for database Services in the Applications UI.

Written By Zoro

Last updated 3 days ago

A database in dFlow

A database in dFlow is a Service with type Database. It is always scoped to an Environment inside an Application, on the same compute as your App and Docker Services.

For how databases behave after creation (tabs, Expose, reference variables), read Databases overview first if you are new to the flow.

Prerequisites

  • An Application with at least one Environment that has compute attached (Worker Node or managed compute, per your workspace).
  • Permission to create Services in that Environment (your Organisation’s roles apply).

Steps

  1. Open Applications and select the Application you want.
  2. Open the target Environment (this is where the database will run).
  3. Click Add New, then Add service (same entry as for App or Docker Services).
  4. Choose Database, then pick an engine (for example Postgres, MySQL, MongoDB). See Databases overview for the full list.
  5. Enter a service name you can recognise in logs and in Reference variables (for example orders-db). Avoid spaces; use a stable name if you will wire App Services to it.
  6. Click Create Service. The service is saved in dFlow; nothing is provisioned on the server until you deploy.
  7. Open the new database Service and click Deploy. Wait until the deployment finishes successfully.
  8. Stay on Overview. Under Internal credentials, confirm you see a connection URL or host, port, user, and password (exact fields depend on engine).

Create Service only registers configuration. Deploy is when dFlow provisions the database on your Environment’s compute and writes Internal credentials.

Connect an app (next step)

Database Services do not have a Variables tab. On your App or Docker Service, open Variables and use `{ }` Reference variables to insert values such as {{ your-db-name.POSTGRES_URI }}. See Service settings under Services in the sidebar and the engine page for your database (for example PostgreSQL).

If something fails

  • Read the Deployments and Logs tabs on the database Service.
  • Database troubleshooting and Deployment issues under Troubleshooting in the sidebar cover common provisioning and connection failures.

Related