Automatic provisioning of Postgres, along an application

Since PostgreSQL Clusters are in first-class support on Fly and Postgres is commonly a main application dependency, it would be great developer experience, if the database can be configured in the TOML file and auto-provisioned together with the application and attached.

For example:

  count = 2 // defaults to 1
  region = lhr // defaults to the app region
  volume_size = 20 // defaults to 10
1 Like

We have two things on the roadmap for Postgres:

  1. fly launch will prompt you to (optionally) create a postgres cluster or attach to an existing one
  2. Region management will update an app and the associated postgres with one command

Adding a database block to the config is interesting, we’ve been experimenting with defining “requirements” for an app to run. That might be a good way to do it it.

Both of these sounds great.

If an OSS project can provide a “Deploy to Fly” button and a single config file (fly.toml) that provisions the application dependencies, that would be fantastic. Similar to the Heroku button and the app.json config.

Also in scripting scenarios, you can run a single flyctl deploy and provide the config file.

Probably deserves a separate thread, but the same can be applied to volumes - provision the app together with a volume, defined in the config file.

1 Like