Manage Relational Databases

Learn how to connect and manage databases in Humanitec.

Introduction

Humanitec supports a range of Relational Database Management Systems (RDBMS) out of the box. In all of these systems there is a distinction between the database and the RDBMS server or instance.

From a resource perspective, Humanitec works with the databases in an already provisioned and running instance.

Humanitec can manage the life-cycle of resources, or use resources that are managed external to Humanitec. These are described by Dynamic and Static resource definitions respectively.

Static Definitions

You would set up a Static Resource Definition if you already had a database created in an instance and wanted to use it as is.

For example: in your Production environment, databases might be managed by a DBA team. Humanitec should just pass the connection parameters through to the running workload as provided by the DBAs.

Humanitec does not need to connect to the instance as it just passes the connection parameters to the workloads at deployment time.

Adding database as a Static Definition

UI
CLI
API
UI
  1. Start in the Static resources tab of the Organization Settings

  2. Choose the database type you want to add by clicking on the relevant icon.

  3. Choose an ID that you will use to identify the definition in Humanitec later. It must be a valid Humanitec ID.

  4. Fill out the connection parameters that the workload will use to connect to the database.

  5. Click the Create button to create the definition.

Steps 1 & 2 of creating a static resource definition for a database.
Steps 3 - 4 of creating a static resource definition for a database.
CLI

Our CLI is currently in closed beta. Please contact us if you want to learn more.

API

Static resource definitions can be created via the Create Static Resource endpoint.

Dynamic Definitions

You would set up a Dynamic Resource Definition when you want Humanitec to dynamically spin up and tear down databases in an existing instance.

For example: when a developer creates a new temporary development environment, Humanitec should create any required databases in the existing instance as necessary. When the environment is deleted, the databases created for that environment should be deleted as well.

In order to create additional databases in the instance, Humanitec needs to connect to the instance.

Access Methods

The access method refers to how Humanitec connects to an RDBMS instance. Currently, 3 access methods are supported out of the box:

Direct

A direct connection is where Humanitec connects directly to the RDBMS instance. The instance must be accessible on the public internet for this to be possible. This is the default configuration when using Aiven managed databases, or public Amazon RDS and Azure Databases.

Over SSH

When connecting over SSH, Humanitec first connects to bastion host or jump server and then makes an onward connection from that server to the instance itself. This is a common way of administering private RDBMS instances, for example a private Amazon RDS instance running inside a private VPC.

Google Cloud SQL Proxy

Google provides their own proxy which can be used to securely connect to private Cloud SQL instances without the need of a dedicated bastion host.

The supported databases along with their access methods are summarised here:

PostgreSQL

MySQL

MariaDB

SQL Server

Direct

coming soon

Over SSH

coming soon

coming soon

Google Cloud SQL Proxy

n/a

coming soon

Adding Databases as Dynamic Definitions