Setup: External database
DeepSource Enterprise uses a PostgreSQL database to store persistent data. By default, an embedded database is provisioned within the Kubernetes cluster. However, for production deployments, we highly recommend bringing your own PostgreSQL database. This document walks through the steps to set up an external database.
Recommended version: PostgreSQL 12
Setting up your database
On a fresh PostgreSQL database, you would have to create a new database and set up a user with sufficient privileges before configuring it for use with DeepSource app.
Following are sample steps to do this on a generic PostgreSQL database. Your steps may vary in case you are using a managed database like AWS RDS or Google CloudSQL.
Log into your database with the postgres user:
psql postgres
Create a new database:
CREATE DATABASE <db-name>;
Create a new PostgreSQL user for the application to use:
CREATE USER <user-name> WITH ENCRYPTED PASSWORD '<password>;
Grant privileges to the database user:
GRANT ALL PRIVILEGES ON DATABASE <db-name> TO <user-name>;
Important: Ensure that the
max_connectionsparameter for the PostgreSQL application is set to at least500. You will have to set a suitableshared_buffersvalue for this value.
Configuring your app to use the external database
- Log into the Admin Console.
- Navigate to the Config section in the admin console.
- Select
Nofor the fieldDeploy embedded database? - Enter the folllowing values for the corresponding fields:
- Application database name: Enter the name of your database name that was created for DeepSource.
- Application database hostname: Enter the hostname/IP of your PostgreSQL server.
- Application database port: Enter the port on which your PostreSQL instance is configured. The default value for this field is
5432. - Application database username: Enter the database username that you created for the database.
- Application database password: Enter the database password for the datbase user you used in the previous step.
- Click on
Save Configto persist this configuration. - Navigate to the Version History page.
- Click
Deploy. - The application will be redeployed with the new database.