Skip to main content

Concepts — PostgreSQL

Architecture​

PostgreSQL on Hikube is a managed service. Each cluster created from the console is a set of replicated PostgreSQL instances, with automatic failover and streaming replication. It belongs to a project and consumes that project's quotas (CPU, memory, storage).


Terminology​

TermDescription
PostgreSQL ClusterManaged instance created from the console, made up of a primary and optional replicas.
ProjectIsolated space that groups your resources and carries the quotas.
PrimaryMain instance that accepts reads and writes.
ReplicaRead-only instance, synchronized from the primary through streaming replication.
Instance presetResource template (CPU, memory) allocated to each node of the cluster.
External accessOption that exposes the cluster on the Internet through a public IP address.
ExtensionPostgreSQL module (for example pgcrypto, vector) enabled per database.
WALWrite-Ahead Log — the PostgreSQL transaction log, the basis of replication.

Replication and high availability​

High availability relies on:

  1. Streaming replication: replicas continuously receive WAL from the primary
  2. Automatic failover: if the primary goes down, a replica is promoted automatically

The number of replicas is chosen at creation, in the Number of replicas field:

Offered valueUse
1 (Standalone)Development, testing
2 (High Availability)Production with one standby
3 (Max High Availability)Critical production
warning

The number of replicas cannot be changed after creation ("The mode cannot be changed after creation"). Choose it according to your availability needs. To change it, contact support.

Synchronous replication (quorum) is not offered in the console; contact support.


Databases, users and rights​

Each cluster has:

  • a postgres system database, created automatically and reserved for the platform (see below);
  • the databases you add, at creation or later (Databases tab), with their extensions;
  • the users you create (Users tab). Each user is granted, database by database, one of the following two rights:
    • Administrator (Admin): read and write;
    • Read-only: read only.

A user's password is generated by the platform and displayed only once, at creation or after a rotation. It cannot be viewed afterwards: if it is lost, generate a new one with Change Password.

System databases​

postgres, template0 and template1 are system databases, reserved for the platform:

  • the user wizards do not offer them, and no right can be granted on them;
  • creating one is refused: ““postgres” is a system database: choose an application database.”;
  • in the database list, Manage extensions and Delete database are disabled on a system database: “System database: it can be neither changed nor deleted.”

A user who already holds a right on a system database keeps it as is. In Manage Access, this right is shown locked, with a warning: you can remove the row, but not change it. Grant your users their rights on application databases.

Naming rules​

ItemRule
Cluster name3 to 16 characters: lowercase letters, digits and hyphens; starts with a letter, ends with a letter or a digit
Username3 to 16 characters: lowercase letters, digits and underscores (_); starts with a lowercase letter or an underscore. No hyphen (-).
Database name1 to 54 characters: lowercase letters, digits, underscores (_) and hyphens (-); starts with a letter or an underscore, but not with pg_

The usernames postgres, admin, root, owner, superuser, streaming_replica, as well as those starting with pg_, are reserved.


Instance presets​

The Instance preset defines the capacity allocated to each node of the cluster. Presets are the virtual machine sizes of the u1, s1 and m1 series: a preset has the same resources as the VM of the same name. The list displayed by the wizard is authoritative:

PresetCPUMemory
u1.medium14Gi
u1.large28Gi
u1.xlarge416Gi
u1.2xlarge832Gi
u1.4xlarge1664Gi
u1.8xlarge32128Gi
s1.small12Gi
s1.medium24Gi
s1.large48Gi
s1.xlarge816Gi
s1.2xlarge1632Gi
s1.4xlarge3264Gi
m1.large216Gi
m1.xlarge432Gi
m1.2xlarge864Gi
m1.4xlarge16128Gi
m1.8xlarge32256Gi

The wizard does not preselect any preset: choose one to continue. Each option shows its resources, for example “u1.medium — 1 CPU / 4Gi”. If the list cannot be loaded, the wizard displays “The preset list could not be loaded. Try again later or contact support.”

A cluster created with a former preset (nano, micro, small, medium, large, xlarge or 2xlarge) keeps it and runs as before: the Edit form shows it as is and saves it unchanged. If a cluster's resources were set outside its preset, the form says so with the mention “(override)”.

Defining custom CPU/memory resources (outside presets) is not offered in the console; contact support.


Network access​

  • Internal host: always assigned, shown in the Internal zone of the Connection and Databases card. It points to the primary and is reachable from the VMs and Kubernetes clusters of the same project, not from another project or from the Internet.
  • External access disabled (default): the cluster is not exposed on the Internet. The External zone shows Disabled.
  • External access enabled: the platform assigns a public IP address, shown in the External zone. The port is the standard PostgreSQL port, 5432.

External access can be enabled or disabled after creation, from Edit. Its cost (public IP address) is included in the wizard's Estimated Cost.


Backup and restore​

PostgreSQL clusters are backed up to an S3 bucket in the project and restored from the Backups tab of their page, with the backup service. Transaction logs are archived continuously between two backups, which makes it possible to restore the database to a point in time. See Configure backups and Restore a backup.


Quotas and cost​

From the Configuration step onwards, the creation wizard displays the Estimated Cost (monthly and hourly) and the cluster's impact on the project quotas (CPU, memory, storage). Consumption takes into account the preset, the number of replicas and the disk size. If the cluster exceeds the available quotas, the Next button stays disabled.

ParameterValue
Disk size1 to 4,096 GB, within the project's storage quota; increase only after creation
Replicas1, 2 or 3

Going further​