A new web service can now get its own PostgreSQL database in the same step. Select Add a PostgreSQL database when you configure the app, pick a plan, and launch.
The database is created alongside the app and connected to it for you:
- its connection string is stored as a secret, named
DATABASE_URLunless you choose another name, and given to the app, so there is nothing to copy; - the app is linked to the database, so you can see them together;
- the summary shows the price of both before you launch, and the database is billed exactly as one you create from Databases.
The app's first deploy waits until the database is online, usually a few minutes, so it never starts without a database to connect to. If the database cannot be created, the app's page says why, you are not billed for it, and Retry database tries again.
Templates that need a database now have the option selected for you, which turns deploying one into two steps instead of three.
When you delete an app, you can now delete its linked databases in the same step. They stay unselected unless you tick them, since a database keeps its data, and its billing, until it is deleted.
See Create an app with a database for the details.