Links
Comment on page

Working with the Tonic application database

Tonic uses a PostgreSQL database to store its internal state. This database does not store customer data. It only stores data that Tonic needs to operate.

Connecting to the Tonic application database

In general, you do not need to connect directly to the Tonic application database. These details are provided if needed for advanced troubleshooting.
When you initially set up Tonic, you provide Tonic with connection details to a PostgreSQL database. How to connect depends on where you set up your PostgreSQL database.

Inside a Docker container

Some customers set up a PostgreSQL database inside the same Docker network as the other Tonic containers. In that case, you should ensure that:
  • Port 5432 is exposed on the PostgreSQL Docker container.
  • Port 5432 is properly mapped.
To do this, add the following section to the PostgreSQL service section of your docker-compose file:
#This will expose Port 5432 on the docker container and map it to
#Port 5432 on the host machine
ports:
- 5432:5432

Standalone PostgreSQL or cloud installation

If you installed PostgreSQL in a standalone fashion, or you use a cloud service such as Amazon RDS, then make sure that the firewall settings and security groups allow a connection on the appropriate port.

Making the connection

You can use any PostgreSQL client. The following example uses psql, the PostgreSQL command line client.
#Format
#psql -h <HOST> -p <PORT> -U <user> -d <Tonic DB name>
#Example
psql -h localhost -p 5432 -U pguser -d allos

Other Tonic application database tips and troubleshooting

How can I reduce the size of the Tonic application database?

The Tonic application database includes a ColumnSchema table that contains the column schema information for your workspace source databases.
By default, when you delete a workspace, Tonic does a soft delete. It marks the workspace as deleted, but does not remove the associated rows from the ColumnSchema table.
To help prevent the table from growing too large, you can configure Tonic to instead do a hard delete, and remove the ColumnSchema rows that are associated with a deleted workspace.
To have Tonic remove the ColumnSchema rows for deleted workspaces, set the environment setting TONIC_DELETE_COLUMN_SCHEMA_ON_WORKSPACE_DELETE to true.
Last modified 8d ago