Questions and answers about Managed Service for PostgreSQL
What is Managed Service for PostgreSQL?
Managed Service for PostgreSQL is a service that helps you create, operate, and scale PostgreSQL databases in the cloud infrastructure.
With Managed Service for PostgreSQL, you can:
- Create a database with the required performance characteristics.
- Scale processing power and storage dedicated for your databases as needed.
- Get database logs.
Managed Service for PostgreSQL takes on labor-intensive Managed Service for PostgreSQL infrastructure administration tasks:
- Monitors resource usage.
- Automatically creates DB backups.
- Provides fault tolerance through automatic failover to backup replicas.
- Keeps the database software updated.
You interact with a database cluster in Managed Service for PostgreSQL in the same way as with a regular database in your local infrastructure. This allows you to manage internal database settings to meet your app's requirements.
What part of DB management and maintenance is Managed Service for PostgreSQL responsible for?
When creating clusters, Managed Service for PostgreSQL allocates resources, installs the DBMS, and creates databases.
For the created and running databases, Managed Service for PostgreSQL automatically creates backups and applies fixes and updates to the DBMS.
Managed Service for PostgreSQL also provides data replication between database hosts (both inside and between availability zones) and automatically switches the load over to a backup replica in the event of a failure.
For which tasks should I use Managed Service for PostgreSQL and for which VMs with databases?
Yandex.Cloud offers two ways to work with databases:
- Managed Service for PostgreSQL allows you to operate template databases with no need to worry about administration.
- With Yandex Compute Cloud VMs, you can create and configure your own databases. This approach allows you to use any database management systems, access databases via SSH, and so on.
What is a database host and database cluster?
A database host is an isolated database environment in the cloud infrastructure with dedicated computing resources and reserved data storage.
A database cluster is one or more database hosts between which replication can be configured.
How do I get started with Managed Service for PostgreSQL?
Managed Service for PostgreSQL is available to all registered Yandex.Cloud users.
To create a database cluster in Managed Service for PostgreSQL, decide what the characteristics will be:
- Host class (performance characteristics such as CPUs, memory, and so on).
- Storage size (reserved in full when you create the cluster).
- The network your cluster will be connected to.
- The number of hosts for the cluster and the availability zone for each host.
For detailed instructions, see the section Getting started with Managed Service for PostgreSQL.
How many DB hosts can a cluster contain?
For a network-based storage (NBS), the number of hosts in a cluster is limited only by the requested computing resources and the size of the storage for the cluster.
For NVMe SSD storage, the number of hosts is limited during cluster creation: for PostgreSQL-clusters, at least three hosts must be created.
How can I access a running DB host?
You can connect to Managed Service for PostgreSQL databases using standard DBMS methods.
How many clusters can I create within a single cloud?
For MDB technical and organizational limitations, see the section Quotas and limits.
How do I maintain database clusters?
Maintenance in Managed Service for PostgreSQL implies:
- Automatic installation of DBMS updates and fixes for your database hosts.
- Changes to the host class and storage size.
- Other Managed Service for PostgreSQL maintenance activities.
Which PostgreSQL version does Managed Service for PostgreSQL use?
Managed Service for PostgreSQL supports PostgreSQL 10 and 11.
What happens when a new DBMS version is released?
The database software is updated when new minor versions are released. The owners of the affected DB clusters receive an advance notice of expected work timing and DB availability.
What happens when a DBMS version becomes deprecated?
One month after the database version becomes deprecated, Managed Service for PostgreSQL automatically sends email notifications to the owners of DB clusters created with this version.
New hosts can no longer be created using deprecated DBMS versions. Seven days within such notification for minor versions and one month for major versions, the database clusters are automatically upgraded to the next supported version. Deprecated major versions are upgraded even if you have disabled their automatic updates.
How is the cost of usage calculated for a database host?
In Managed Service for PostgreSQL, the usage cost is calculated based on the following parameters:
- Selected host class.
- Size of the storage reserved for the database host.
- Size of the database cluster backups. Backup space in the amount of the reserved storage is free of charge. Storage of backups in excess of this size is charged at special rates.
- Number of hours of database host operation. Partial hours are rounded to an integer value. The cost per hour of operation for each host class is given in the section Pricing policy for Managed Service for PostgreSQL.
How can I change the computing resources and storage size for a database cluster?
You can change the computing resources and storage size in the management console. All you need to do is choose a different host class for the required cluster.
The cluster characteristics change within 30 minutes. During this period, other maintenance activities may also be enabled for the cluster, such as installing updates.
Is DB host backup enabled by default?
Yes, backup is enabled by default. For PostgreSQL, a full backup is performed once a day with all DB cluster transaction logs saved. This allows you to restore the cluster state to any point in time during the backup storage period, except for the last 30 seconds.
By default, backups are stored for seven days.
When is backup performed? Is a DB cluster available during backup?
The backup window is an interval during which a full daily backup of the DB cluster is performed. The backup window is from 01:00 a.m. to 05:00 a.m. (UTC+3).
Clusters remain fully accessible during the backup window.
What metrics and processes can be tracked using monitoring?
For all DBMS types, you can track:
- CPU, memory, network, or disk usage, in absolute terms.
- Memory, network, or disk usage as a percentage of the set limits for the corresponding cluster's host class.
- The amount of data in the DB cluster and the remaining free space in the data storage.
For any DB hosts, you can track metrics specific to the type of the corresponding DBMS. For example, for PostgreSQL, you can track:
- Average query execution time
- Number of queries per second
- Number of errors in logs, etc.
Monitoring can be performed with a minimum granularity of 5 seconds.
Questions about PostgreSQL
How to import data to a PostgreSQL database cluster in Managed Service for PostgreSQL?
Use the built-in tool
pg_dump to migrate data to a PostgreSQL cluster in Managed Service for PostgreSQL.
Which PostgreSQL versions does Managed Service for PostgreSQL support?
Managed Service for PostgreSQL supports only PostgreSQL 10 and 11.
Is DB cluster backup enabled by default?
Yes, backup is enabled by default. For PostgreSQL clusters, a full backup is performed once a day with all DB cluster transaction logs saved. This allows you to restore the cluster state to any point in time during the backup storage period, except for the last 30 seconds.
Is a PostgreSQL DB cluster connection encrypted?
Connections between a database cluster and an application are always encrypted using SSL. You cannot disable cluster connection encryption.
What is a read-only replica in PostgreSQL?
A read-only replica is a host in a PostgreSQL DB cluster that can only be read. Its data is synced with the master host (applies only if the cluster has more than one host). You can use a read-only replica to reduce the load on the DB master host with a large number of read requests.
What extensions for PostgreSQL are supported in Managed Service for PostgreSQL?
The list of supported extensions for PostgreSQL is given in the section Managing PostgreSQL extensions.
What limitations are imposed on PostgreSQL database clusters?
Learn more about Managed Service for PostgreSQL limitations in the section Quotas and limits. The section Host classes provides characteristics of clusters that can be created using Managed Service for PostgreSQL.