Cennso Database concepts
Important
The concepts documentation provides only reference information about the concepts that are used when you deploy a MySQL or PostgreSQL cluster and its components. You can use it to understand what the Cennso Database resources provide and how to configure them.
For more information on how to deploy and operate the Cennso Database and its components, read the Deployment and Operation guides.
The Cennso Database extension lets you deploy and operate MySQL and PostgreSQL clusters with Cennso. You describe a database cluster, its storage, backups, logical databases, and users as Kubernetes Custom Resources on the Management Cluster, the same way you provision any other Cennso workload. The extension then deploys and configures the database cluster on the target Kubernetes cluster.
The two main concepts are:
Both concepts are presented with the Kubernetes Custom Resources and have common configuration parameters, as well as configuration parameters specific to the given Custom Resource.
For more information on how to configure and deploy the database operator and the other components, see the documents in the left navigation.
Database Operator
Database Operator automates managing your MySQL and PostgreSQL databases on Kubernetes clusters. The main role of the database operator is to install and reconcile the database instances to ensure that all resources defined by a user are in the desired state.
You can define the database operator using the corresponding Custom Resources:
DBOperator- for the MySQL operatorPostgreSQLOperator- for the PostgreSQL operator
Database Instance
A Database Instance is an instance of a MySQL or PostgreSQL server. A set of database instances forms a MySQL or PostgreSQL cluster with asynchronous replication between the database instances. You can define the database instance using the corresponding Custom Resources:
DBInstance- for the MySQL server instancesPostgreSQLInstance- for the PostgreSQL server instances
Supporting services
Next to the database instances, each database cluster runs supporting services. They give the database clients a single endpoint and keep the replication topology of the cluster healthy when a database instance fails. The set of supporting services depends on the database server.
MySQL supporting services
Two helper services are deployed to every MySQL cluster:
- HAProxy - exposes an endpoint for the database clients and provides the ability to balance connections across the MySQL instances.
- MySQL Orchestrator - constantly tracks replication topology of the MySQL cluster, replication lag, and node health. It can promote a replica when the primary is unavailable.
PostgreSQL supporting services
Two helper services run with every PostgreSQL cluster:
- PgBouncerOpens in a new tab - exposes an endpoint for the database clients, pools their connections, and routes them to the current primary.
- Patroni - runs inside every PostgreSQL instance rather than as a separate service. It tracks the replication topology of the PostgreSQL cluster and node health, and promotes a replica when the primary is unavailable.
Additional concepts
In addition, the Cennso Database extension provides the following concepts to simplify the operations and management of your database clusters:
Database backup
A Database Backup defines backup jobs for database instances managed by the Database Operator. It uses ResticOpens in a new tab together with a backup utility to produce consistent, encrypted delta backups on a configurable schedule and store them in a storage-agnostic backend.
The backup utility depends on the database server type:
- Percona XtraBackupOpens in a new tab to perform MySQL backups
- pg_basebackupOpens in a new tab to perform PostgreSQL backups
You can define a database backup using the corresponding Custom Resources:
DBBackupfor MySQL databasesPostgreSQLBackupfor PostgreSQL databases
For more information on how to configure backups, read the following documents:
- Cennso Database Backup and Back up and restore for MySQL databases
- Cennso PostgreSQL Backup and Back up and restore Cennso PostgreSQL for PostgreSQL databases
Database TLS certificate
A Database TLS Certificate defines a TLS certificate that secures connections to the database cluster. By default, if you do not specify any TLS options, both MySQL and Postgres use TLS certificates issued and renewed through cert-managerOpens in a new tab.
To configure the validity of TLS certificates, you have different options for each type of database.
To set the custom renewal period of the TLS certificates for the PostgreSQL cluster, you can use the following configuration options:
- spec.cert.certValidityDuration
- spec.cert.caValidityDuration
For more information on how to configure a TLS certificate for PostgreSQL cluster, read the following documents:
To set the custom renewal period of the TLS certificates for the MySQL cluster, you can use the DBTLSCertificate Custom Resource.
For more information on how to configure a TLS certificate for MySQL databases, read the following documents:
Database schema
A Database Schema defines a logical database, provisioned by a job in an existing Database Instance. For MySQL databases, it also defines the default character set and collation.
You can define a database schema using the corresponding Custom Resources:
DBSchemafor MySQL databasesPostgreSQLSchemafor PostgreSQL databases
For more information on how to provision a logical database, read the following documents:
- Cennso Database Schema and Create a database for MySQL databases
- Cennso PostgreSQL Schema and Create a PostgreSQL database for PostgreSQL databases
Database user
A Database User defines a user account provisioned by a job in an existing Database Instance.
You can define a database user using the corresponding Custom Resources:
DBUserfor MySQL databasesPostgreSQLUserfor PostgreSQL databases
For more information on how to provision a user with privileges, read the following documents:
- Cennso Database User and Create a database user for MySQL databases
- Cennso PostgreSQL User and Create a PostgreSQL user for PostgreSQL databases