Databases
Create a database service and configure your application to connect to it.
Available database types
The dashboard offers PostgreSQL, MySQL, MongoDB, Redis, and MariaDB. Choose the database type your application supports.
Create a database
- Open your project and choose New Database.
- Select the database type and complete the required fields shown in the form.
- Select Create and check the database's status.
- Open the database detail page to find its connection information.
Database creation counts toward your plan's database allowance. Wait for the service to finish deploying before testing a connection.
Connect your application
The detail page shows internal connection information and, when configured, external connection information. Use the connection information appropriate to where your client runs. An internal hostname is not an address you can necessarily reach from your laptop.
Copy the connection string or individual host, port, username, password, and database name into your application's environment variables. Use the variable names your application expects; not every framework uses the same names.
Save the variables and deploy the application. Test a database operation from the application itself.
Handle credentials carefully
Connection strings can contain passwords. Keep them out of source control, browser code, screenshots, and support messages. Mask credentials before sharing an error log.
Backups and deletion
Do not assume that creating a database also establishes a backup schedule. Confirm backup coverage and recovery requirements with support before storing important data. Make a recoverable backup before deleting a database or making a destructive schema change.