Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
IONOS's Database as a Service (DBaaS) consists of fully managed databases, with high availability, performance, and reliability hosted in IONOS Cloud and integrated with other IONOS Cloud services.
We currently offer the following database engines:
IONOS DBaaS lets you quickly set up and manage MongoDB database clusters. Using IONOS DBaaS, you can manage MongoDB clusters, along with their scaling, security and creating snapshots for backups. The feature offers the following editions of MongoDB to meet your enterprise-level deployments: Playground, Business, and Enterprise. For more information, see Overview.
IONOS DBaaS gives you access to the capabilities of the PostgreSQL database engine. Using IONOS DBaaS, you can manage PostgreSQL cluster operations, database scaling, patch your database, create backups, and security.
In the DCD > Databases, the database resources allocated as per your user contract is displayed in the Resource Allocation. The resources refers to the Postgres Clusters, MongoDB Clusters, Cores, RAM, and Storage databases quota. For each of these resources, this section shows the number of resources you can use and also the count of resources already consumed. Based on the resources avaialble here, you can allocate resources during the creation of a MongoDB cluster. To avail additional resource allocation, contact IONOS Cloud Support.
Single-node cluster: A single-node cluster only has one node which is called the primary node. This node accepts customer connections and performs read/write operations. This is a single point of truth as well as a single point of failure.
Multi-node cluster: In addition to the primary node, this cluster contains standby nodes that can be promoted to primary if the current primary fails. The nodes are spread across availability zones. Currently, we use warm standby nodes, which means they don't serve read requests. Hot standby functionality (when the nodes can serve read requests) might be added in the future.
Existing clusters can be scaled in two ways: horizontal and vertical.
Horizontal scaling is defined as configuring the number of instances that run in parallel. The number of nodes can be increased or decreased in a cluster.
Scaling up the number of instances does not cause a disruption. However, decreasing may cause a switch over, if the current primary node is removed.
Note: This method of scaling is used to provide high availability. It will not increase performance.
Vertical scaling refers to configuring the size of the individual instances. This is used if you want to process more data and queries. You can change the number of cores and the size of memory to have the configuration that you need. Each instance is maintained on a dedicated node. In the event of scaling up or down, a new node will be created for each instance.
Once the new node becomes available, the server will switch from the old node to the new node. The old node is then removed. This process is executed sequentially if you have multiple nodes. We will always replace the standby first and then the primary. This means that there is only one switchover.
During the switch, if you are connected to the DB with an application, the connection will be terminated. All ongoing queries will be aborted. Inevitably, there will be some disruption. It is therefore recommended that the scaling is performed outside of peak times.
You can also increase the size of storage. However, it is not possible to reduce the size of the storage, nor can you change the type of storage. Increasing the size is done on-the-fly and causes no disruption.
The synchronization_mode
determines how transactions are replicated between multiple nodes before a transaction is confirmed to the client. IONOS DBaaS supports three modes of replication: Asynchronous (default), Synchronous and Strict Synchronous. In either mode the transaction is first committed on the leader and then replicated to the standby node(s).
Asynchronous replication does not wait for the standby before confirming a transaction back to the user. Transactions are confirmed to the client after being written to disk on the primary node. Replication takes place in the background. In asynchronous mode the cluster is allowed to lose some committed (not yet replicated) transactions during a failover to ensure availability.
The benefit of asynchronous replication is the lower latency. The downside is that recent transactions might be lost if standby is promoted to leader. The lag between the leader and standby tends to be a few milliseconds.
Caution: Data loss might happen if the server crashes and the data has not been replicated yet.
Synchronous replication ensures that a transaction is committed to at least one standby before confirming the transaction back to the client. This standby is known as synchronous standby. If the primary node experiences a failure then only a synchronous standby can take over as primary. This ensures that committed transactions are not lost during a failover. If the synchronous standby fails and there is another standby available then the role of the synchronous standby changes to the latter. If no standby is available then the primary can continue in standalone mode. In standalone mode the primary role cannot change until at least one standby has caught up (regained the role of synchronous standby). Latency is generally higher than with asynchronous replication, but no data is lost during a failover.
At any time there will be at most one synchronous standby. If the synchronous standby fails then another healthy standby is automatically selected as the synchronous standby.
Caution: Turning on non-strict synchronous replication does not guarantee multi node durability of commits under all circumstances. When no suitable standby is available, the primary node will still accept writes, but does not guarantee their replication.
Strict synchronous replication is the same as synchronous replication with the exception that standalone mode is not permitted. This mode will prevent PostgreSQL from switching off the synchronous replication on the primary when no synchronous standby candidates are available. If no standby is available, no writes will be accepted anymore, so this mode sacrifices availability for replicated durability.
If replication mode is set to synchronous (either strict or non-strict) then data loss cannot occur during failovers (e.g. node failures). The benefit of strict replication is that data is not lost in case of a storage failure of the primary node and a simultaneous failure of all standby nodes.
Please note that synchronization modes can impact DBaaS in several ways:
The performance penalty of synchronous over asynchronous replication depends on the workload. The primary handles transactions the same way in all replications modes, with the exception of COMMIT statements (incl. implicit transactions). When synchronous replication is enabled, the commit can only be confirmed to the client once it is replicated. Thus, there is a constant latency overhead for each transaction, independent of the transaction's size and duration.
Caution: You cannot enforce a synchronous commit when the cluster is configured to use asynchronous replication. Without a synchronous standby any setting higher than local
is equivalent to local
, which doesn't wait for replication to complete. Instead, you can configure your cluster to use synchronous replication and choose synchronous_commit=local
whenever data loss is acceptable.
PostgreSQL Backups: A cluster can have multiple backups. They are created
When a cluster is created
When the PostgreSQL version is changed to a higher major version
When a Point-In-Time-Recovery operation is conducted.
At any time, Postgres only ships to one backup. We use combined with continuous WAL archiving. A base backup is done via pg_basebackup regularly, and then WAL records are continuously added to the backup. Thus, a backup doesn't represent a point in time but a time range. We keep backups for the last 7 days so recovery is possible for up to one week in the past.
Data is added to the backup in chunks of 16MB or after 30 minutes, whichever comes first. Failures and delays in archiving do not prevent writes to the cluster. If you restore from a backup then only the data that is present in the backup will be restored. This means that you may lose up to the last 30 minutes or 16MB of data if all replicas lose their data at the same time.
You can restore from any backup of any PostgreSQL cluster as long as the backup was created with the same or an older PostgreSQL major version.
Backups are stored encrypted in an IONOS S3 Object Storage bucket in the same region your database is in. Databases in regions without IONOS S3 Object Storage will be backed up to eu-central-2
.
Warning: When a database is stopped all transactions since the last WAL segment are written to a (partial) WAL file and shipped to the IONOS S3 Object Storage. This also happens when you delete a database. We provide an additional security timeout of 5 minutes to stop and delete the database gracefully. However, under rare circumstances it could happen that this last WAL Segment is not written to the IONOS S3 Object Storage (e.g. due to errors in the communication with the IONOS S3 Object Storage) and these transactions get lost.
As an additional security mechanism you can check which data has been backed up before deleting the database. To verify which was the last archived WAL segment and at what time it was written you can connect to the database and get information from the pg_stat_archiver.
The `last_archived_time might be older than 30 minutes (WAL files are created with a specific timeout, see above) which is normal if there is no new data added.
We provide Point-in-Time-Recovery (PITR). When recovering from a backup, the user chooses a specific backup and provides a time (optional), so that the new cluster will have all the data from the old cluster up until that time (exclusively). If the time was not provided, the current time will be used.
It is possible to set the recoveryTargetTime
to a time in the future. If the end of the backup is reached before the recovery target time is met then the recovery will complete with the latest data available.
Note: WAL records shipping is a continuous process and the backup is continuously catching up with the workload. Should you require that all the data from the old cluster is completely available in the new cluster, stop the workload before recovery.
Planned failover: During a failure or planned failover, the client must reconnect to the database. A planned failover is signaled to the client by the closing of the TCP connection on the server. The client must also close the connection and reconnect.
In the event of a failure, the connection might not be closed correctly. The new leader will send a gratuitous ARP packet to update the MAC address in the client's ARP table. Open TCP connections will be reset once the client sends a TCP packet. We recommend re-establishing a connection to the database by using an exponential back-off retry with an initial immediate retry.
Uncontrolled disconnection: Since we do not allow read connections to standby nodes, only primary disconnections are possible. However, uncontrolled disconnections can happen during maintenance windows, a cluster change, and during unexpected situations such as loss of storage disk space. Such disconnections are destructive for the ongoing transactions and also clients should reconnect.
If a node is disconnected from the cluster, then a new node will be created and provisioned. Losing a primary node leads to the same situation when a client should reconnect. Losing a replica is not noticeable to the customer.
IONOS Cloud updates and patches your database cluster to achieve high standards of functionality and security. This includes minor patches for PostgreSQL, as well as patches for the underlying OS. We try to make these updates unnoticeable to your operation. However, occasionally, we might have to restart your PostgreSQL instance to allow the changes to take effect. These interruptions will only occur during the maintenance window for your database, which is a weekly four-hour window.
When your cluster only contains one replica you might experience a short down-time during this maintenance window, while your database instance is being updated. In a replicated cluster, we only update standbys, but we might perform a switchover in order to change the leader node.
Considerations: Updates to a new minor version are always backward compatible. Such updates are done during the maintenance window with no additional actions from the user side.
Major Version Upgrades
Caution: Major changes of the PostgreSQL version are irreversible and can fail. You should read the official migration guide and test major version upgrades with an appropriate development cluster first.
Prerequisites:
Test the upgrade on development cluster with similar / the same data (you can create a new database cluster as a clone of your existing cluster)
Prepare for a downtime during the major version upgrade
Ensure the database cluster has enough available storage. While the upgrade is space-efficient (i.e. it does not copy the data directory), some temporary data is written to disk.
Before upgrading PostgreSQL major versions, customers should be aware that IONOS Cloud is not responsible for customer data or any utilized postgreSQL functionality. Hence, it is the responsibility of the customer to ensure that the migration to a new PostgreSQL major version does not impact their operations.
When a major version approaches its end of life (EOL), we will announce the deprecation and removal of the version at least 3 months in advance. About 1 month before the EOL, no new database can be created with the deprecated version (the exact date will be part of the first announcement). When the EOL is reached, not yet upgraded databases will be upgraded in their next maintenance window.
DBaaS for PostgreSQL is fully integrated into the and has a dedicated . You may also launch it via automation tools like and .
Compatibility: DBaaS gives you access to the capabilities of the PostgreSQL database engine. This means that the code, applications, and tools you already use today with your existing databases can be used with DBaaS. IONOS Cloud currently supports PostgreSQL versions 12, 13, 14, and 15.
Deprecation Notice: Version 11 is currently still supported but will reach end of life on 9 Nov 2023 (). It will soon be removed from IONOS Cloud.
Locations: As of December 2022, DBaaS is offered in all IONOS Cloud Locations.
Scalable: Fully managed clusters that can be scaled on demand.
High availability: Multi-node clusters with automatic node failure handling.
Security: Communication between clients and the cluster is encrypted using TLS certificates from Let's Encrypt.
Upgrades: Customer-defined maintenance windows, with minimal disruption due to planned failover (approx. few seconds for multi-node clusters).
Backup: Base backups are carried out daily, with Point-in-Time recovery for one week.
Cloning: Customers also have the option to clone clusters via backups.
Restore: Databases can be restored in place or to a different target cluster.
Resources: Offered on Enterprise VM, with a dedicated CPU, storage, and RAM. Storage options are SSD or HDD, with SSD now including encryption-at-rest.
Network: DBaaS supports private LANs.
Extensions: DBaaS supports several .
Note: IONOS Cloud doesn’t allow superuser access for PostgreSQL services. However, most DBA-type actions are still available through other methods.
DBaaS services offered by IONOS Cloud:
Our platform is responsible for all back-end operations required to maintain your database in optimal operational health.
Database installation via the DCD or the DBaaS API.
Pre-set database configuration and configuration management options.
Automation of backups for a period of 7 days.
Regular patches and upgrades during maintenance.
Disaster recovery via automated backup.
Service monitoring: both for the database and the underlying infrastructure.
Customer database administration duties:
Tasks related to the optimal health of the database remain the responsibility of the customer. These include:
Optimisation.
Data organisation.
Creation of indexes.
Updating statistics.
Consultation of access plans to optimize queries.
To conserve disk space, log files are rotated according to size. Logs should not consume more than 175 MB of disk storage. The files are continuously monitored and log messages are shipped to a central storage location with a retention policy of 30 days.
Password encryption: Client libraries must support SCRAM-SHA-256 authentication. Make sure to use an up-to-date client library.
Certificates are issued for the DNS name of the cluster which is assigned automatically during creation and will look similar to pg-abc123.postgresql.de-txl.ionos.com
. It is available via the IONOS API as the dnsName
property of the cluster
resource.
Here is how to verify the certificate using the psql
command line tool:
Resource quotas: Each customer contract is allotted a resource quota. The available number of CPUs, RAM, storage, and database clusters is added to the default limitations for a VDC contract.
16 CPU Cores
32 GB RAM
1500 GB Disk Space
10 database clusters
5 nodes within a cluster
Additionally, a single instance of your database cluster can not exceed 16 cores and 32GB RAM.
Calculating RAM Requirements: The RAM size must be chosen carefully. There is 1 GB of RAM reserved to capture resource reservation for OS system daemons. Additionally, internal services and tools use up to 500 MB of RAM. To choose a suitable RAM size, the following formula must be used.
ram_size
= base_consumption
+ X * work_mem
+ shared_buffers
The base_consumption
and reservation of internal services is approximately 1500 MB.
X is the number of parallel connections. The value work_mem
is set to 8 MB by default.
The shared_buffers
is set to about 15% of the total RAM.
Calculating Disk Requirements:
The requested disk space is used to store all the data that Postgres is working with, incl. database logs and WAL segments. Each Postgres instance has its storage (of the configured size). The operating system and applications are kept separately (outside of the configured storage) and are managed by IONOS.
If the disk runs full Postgres will reject write requests. Make sure that you order enough margin to keep the Postgres cluster operational. You can monitor the storage utilization in DCD.
WAL segments: In normal operation mode, older WAL files will be deleted once they have been replicated to the other instances and backed up to archive. If either of the two shipments is slow or failing then WAL files will be kept until the replicas and archive catch up again. Account for enough margin, especially for databases with high write load.
Log files: Database log files (175 MB) and auxiliary service log files (~100 MB) are stored on the same disk as the database.
CPU: The total upper limit for CPU cores depends on your quota. A single instance cannot exceed 16 cores.
RAM: The total upper limit for RAM depends on your quota. A single instance cannot exceed 32 GB.
Storage: The upper limit for storage size is 2 TB.
Backups: Storing cluster backups in an IONOS S3 Object Storage is limited to the last 7 days.
IP Ranges: The following IP ranges cannot be used with our PostgreSQL services:
10.208.0.0/12
10.233.0.0/18
192.168.230.0/24
10.233.64.0/18
Database instances are placed in the same location as your specified LAN, so network performance should be comparable to other machines in your LAN.
Estimates: A test with pgbench (scaling factor 1000, 20 connections, duration 300 seconds, not showing detailed logs) and a single small instance (2 cores, 3 GB RAM, 20 GB HDD) resulted in around 830 transactions per second (read and write mixed) and 1100 transactions per second (read-only). For a larger instance (4 cores, 8 GB RAM, 600GB Premium SSD) the results were around 3400 (read and write) and 19000 (read-only) transactions per second. The database was initialized using pgbench -i -s 1000 -h <ip> -U <username> <dbname>
. For benchmarking the command line used was pgbench -c 20 -T 300 -h <ip> -U <username> <dbname>
for the read/write tests, and pgbench -c 20 -T 300 -S -h <ip> -U <username> <dbname>
for the read-only tests.
There are several PostgreSQL extensions preinstalled, that you can enable for your cluster. You can enable the extension by logging into your cluster and executing:
The following table shows which extensions are enabled by default and which can be enabled (PostgreSQL version 12):
Note: With select * from pg_available_extensions;
you will see more available extensions, but many of them can't be enabled or used without superuser rights and thus aren't listed here.
Aspect | Asynchronous | Synchronous |
---|
By default, the replication mode of the database cluster determines the guarantees of a committed transaction. However, some workloads might have very diverse requirements regarding accepted data loss vs performance. To address this need, commit guarantees can be changed per transaction. See for details.
Read the migration guide from Postgres (e.g. ) and make sure your database cluster can be upgraded
As per : "New major versions also typically introduce some user-visible incompatibilities, so application programming changes might be required."
Starting with version 10, PostgreSQL moved to a yearly release schedule, where each major version is supported for 5 years after initial release. You can find more details at . We strive to support new versions as soon as possible.
Logs: The logs that are generated by a database are stored on the same disk as the database. We provide logs for connections, disconnections, waiting for locks, DDL statements, any statement that ran for at least 500 ms, and any statement that caused an error (see PostgreSQL ). Currently, we do not provide an option to change this configuration.
Write-Ahead Logs: PostgreSQL uses (WAL) for continuous archiving and point-in-time recovery. These logs are created in addition to the regular logs.
Every change to the database is recorded in the WAL record. WALs are generated along with daily base backups and offer a consistent snapshot of the database as it was at that time. WALs and backups are automatically deleted after 7 days, which is the earliest point in time you can recover from. Please consult for more information.
Connection encryption: All client connections are encrypted using TLS; the default is prefer
and clients cannot disable it. Server certificates are issued by Let's Encrypt and the root certificate is . This needs to be made available to the client for verify-ca
and verify-full
to function.
Connection Limits: The value for is calculated based on RAM size.
RAM size | max_connections |
---|
The superuser needs to maintain the state and integrity of the database, which is why the platform reserves 11 connections for internal use: connections for superusers (see ), for replication.
Note: To cite the : "It is very easy to use pgbench to produce completely meaningless numbers". The numbers shown here are only ballpark figures and there are no performance guarantees. The real performance will vary depending on your workload, the IONOS location, and several other factors.
Extension | Enabled | Version | Description |
---|
primary failure | A healthy standby will be promoted if the primary node becomes unavailable. | Only standby nodes that contain all confirmed transactions can be promoted. |
Standby failure | No effect on primary. Standby catches up once it is back online. | In strict mode at least one standby must be available to accept write requests. In non-strict mode the primary continues as standalone. There is a short delay in transaction processing if the synchronous standby changes. |
Consistency model | Strongly consistent (expect for lost data.) | Strongly consistent (expect for lost data.) |
Data loss during failover | Non-replicated data is lost. | Not possible. |
Data loss during primary storage failure | Non-replicated data is lost. | Non-replicated data is lost in standalone mode. |
Latency | Limited by the performance of the primary. | Limited by the performance of the primary, the synchronous standby and the latency between them (usually below 1ms). |
2GB | 128 |
3GB | 256 |
4GB | 384 |
5GB | 512 |
6GB | 640 |
7GB | 768 |
8GB | 896 |
> 8GB | 1000 |
plpython3u | X | 1.0 | PL/Python3U untrusted procedural language |
pg_stat_statements | X | 1.7 | track execution statistics of all SQL statements executed |
intarray | 1.2 | functions, operators, and index support for 1-D arrays of integers |
pg_trgm | 1.4 | text similarity measurement and index searching based on trigrams |
pg_cron | 1.3 | Job scheduler for PostgreSQL |
set_user | 3.0 | similar to SET ROLE but with added logging |
timescaledb | 2.4.2 | Enables scalable inserts and complex queries for time-series data |
tablefunc | 1.0 | functions that manipulate whole tables, including crosstab |
pg_auth_mon | X | 1.1 | monitor connection attempts per user |
plpgsql | X | 1.0 | PL/pgSQL procedural language |
pg_partman | 4.5.1 | Extension to manage partitioned tables by time or ID |
hypopg | 1.1.4 | Hypothetical indexes for PostgreSQL |
postgres_fdw | X | 1.0 | foreign-data wrapper for remote PostgreSQL servers |
btree_gin | 1.3 | support for indexing common datatypes in GIN |
pg_stat_kcache | X | 2.2.0 | Kernel statistics gathering |
citext | 1.6 | data type for case-insensitive character strings |
pgcrypto | 1.3 | cryptographic functions |
earthdistance | 1.1 | calculate great-circle distances on the surface of the Earth |
postgis | 3.2.1 | PostGIS geometry and geography spatial types and functions |
cube | 1.4 | data type for multidimensional cubes |
To view cluster metrics in DCD, select the cluster of interest from the available Databases. The chosen database will open up. In Properties, select the database name next to the Monitor Databases option. The cluster metrics will open up:
It is possible to choose a time frame for metrics and instances of interest.
Planned failover: During a failure or planned failover, the client must reconnect to the database. A planned failover is signaled to the client by the closing of the TCP connection on the server. The client must also close the connection and reconnect.
In the event of a failure, the connection might not be closed correctly. The new leader will send a gratuitous ARP packet to update the MAC address in the client's ARP table. Open TCP connections will be reset once the client sends a TCP packet. We recommend re-establishing a connection to the database by using an exponential back-off retry with an initial immediate retry.
Uncontrolled disconnection: Since we do not allow read connections to standby nodes, only primary disconnections are possible. However, uncontrolled disconnections can happen during maintenance windows, a cluster change, and during unexpected situations such as loss of storage disk space. Such disconnections are destructive for the ongoing transactions and also clients should reconnect.
If a node is disconnected from the cluster, then a new node will be created and provisioned. Losing a primary node leads to the same situation when a client should reconnect. Losing a replica is not noticeable to the customer.
IONOS Cloud updates and patches your database cluster to achieve high standards of functionality and security. This includes minor patches for PostgreSQL, as well as patches for the underlying OS. We try to make these updates unnoticeable to your operation. However, occasionally, we might have to restart your PostgreSQL instance to allow the changes to take effect. These interruptions will only occur during the maintenance window for your database, which is a weekly four-hour window.
When your cluster only contains one replica you might experience a short down-time during this maintenance window, while your database instance is being updated. In a replicated cluster, we only update standbys, but we might perform a switchover in order to change the leader node.
Considerations: Updates to a new minor version are always backward compatible. Such updates are done during the maintenance window with no additional actions from the user side.
Caution: Major changes of the PostgreSQL version are irreversible and can fail. You should read the official migration guide and test major version upgrades with an appropriate development cluster first.
Prerequisites:
Read the migration guide from Postgres (e.g. to version 13) and make sure your database cluster can be upgraded
Test the upgrade on development cluster with similar / the same data (you can create a new database cluster as a clone of your existing cluster)
Prepare for a downtime during the major version upgrade
Ensure the database cluster has enough available storage. While the upgrade is space-efficient (i.e. it does not copy the data directory), some temporary data is written to disk.
Before upgrading PostgreSQL major versions, customers should be aware that IONOS Cloud is not responsible for customer data or any utilized postgreSQL functionality. Hence, it is the responsibility of the customer to ensure that the migration to a new PostgreSQL major version does not impact their operations.
As per PostgreSQL official documentation: "New major versions also typically introduce some user-visible incompatibilities, so application programming changes might be required."
Starting with version 10, PostgreSQL moved to a yearly release schedule, where each major version is supported for 5 years after initial release. You can find more details at https://www.postgresql.org/support/versioning/. We strive to support new versions as soon as possible.
When a major version approaches its end of life (EOL), we will announce the deprecation and removal of the version at least 3 months in advance. About 1 month before the EOL, no new database can be created with the deprecated version (the exact date will be part of the first announcement). When the EOL is reached, not yet upgraded databases will be upgraded in their next maintenance window.
Prerequisites: Prior to setting up a database, please make sure you are working within a provisioned VDC that contains at least one virtual machine from which to access the database. The VM you create is counted against the quota allocated in your contract.
Note: Database Manager is available only for contract administrators, owners, and users with Access and manage DBaaS privilege. You can set the privilege via the DCD group privileges.
1. To create a Postgres cluster, go to Menu > Databases.
2. In the Databases tab, click + Add in the Postgres Clusters section to create a new Postgres Cluster.
3. Provide an appropriate Display Name.
4. To create a Postgres Cluster from the available backups directly, you can go to the Create from Backup section and follow these steps:
Select a Backup from the list of cluster backups in the dropdown.
Select the Recovery Target Time field. A modal will open up.
Select the recovery date from the calendar.
Then, select the recovery time using the clock.
5. Choose a Location where your data for the database cluster will be stored. You can select an available datacenter within the cluster's data directory to create your cluster.
6. Select a Backup Location that is explicitly your backup location (region). You can have off-site backups by using a region that is not included in your database region.
7. In the Cluster to Datacenter Connection section, provide the following information:
Data Center: Select a datacenter from the available list.
LAN: Select a LAN for your datacenter.
Private IP/Subnet: Enter the private IP or subnet using the available Private IPs.
Once done, click the Add Connection option to establish your cluster to datacenter connection.
Note: To know your private IP address/Subnet, you need to:
Create a single server connected to an empty private LAN and check the IP assigned to that NIC in that LAN. The DHCP in that LAN always uses a /24 subnet, so you must reuse the first 3 IP blocks to reach your database.
To prevent a collision with the DHCP IP range, it is recommended to use IP addresses ending between x.x.x.3/24 and x.x.x.10/24 (which are never assigned by DHCP).
If you have disabled DHCP on your private LAN, you must discover the IP address on your own.
8. Select the appropriate Postgres Version. IONOS Database Manager supports versions 11, 12, 13, 14, and 15.
Deprecation Notice: Support for version 11 will soon be removed and should not be used for new clusters.
9. Enter the number of Postgres Instances in the cluster. One Postgres instance always manages the data of exactly one database cluster.
Note: Here, you will have a primary node and one or more standby nodes that run a copy of the active database, so you have n-1 standby instances in the cluster.
10. Select the mode of replication in the Synchronization Mode field; asynchronous mode is selected by default. The following are the available replication modes:
Asynchronous mode: In asynchronous mode, the primary PostgreSQL instance does not wait for a replica to indicate that it wrote the data. The cluster can lose some committed transactions to ensure availability.
Synchronous mode: Synchronous replication allows the primary node to be run standalone. The primary PostgreSQL instance will wait for any or all replicas. So, no transactions are lost during failover.
Strictly Synchronous: It is similar to the synchronous mode but requires two operating nodes.
11. Provide the initial values for the following:
CPU Cores: Select the number of CPU cores using the slider or choose from the available shortcut values.
RAM Size: Select the RAM size using the slider or choose from the available shortcut values.
Storage Type: SSD Premium is set by default.
Storage Size: Enter the size value in Gigabytes.
The Estimated price will be displayed based on the input. The estimated cost is exclusive, where certain variables like traffic and backup are not considered.
12. Provide the Database User Credentials, such as a suitable username and an associated password.
Note: The credentials will be overwritten if the user already exists in the backup.
13. In the Maintenance Window section, you can set a Maintenance time using the pre-defined format (hh:mm:ss) or the clock. Select a Maintenance day from the dropdown list. The maintenance occurs in a 4-hour-long window. So, adjust the time accordingly.
14. Click Save to create the Postgres Cluster.
Your Postgres Cluster is now created.
Endpoint: https://api.ionos.com/docs/postgresql/v1/
To make authenticated requests to the API, you must include a few fields in the request headers. Please find relevant descriptions below:
We use curl
in our examples, as this tool is available on Windows 10, Linux and macOS. Please refer to our blogpost about curl
on Windows if you encounter any problems:
There are several PostgreSQL extensions preinstalled, that you can enable for your cluster. You can enable the extension by logging into your cluster and executing:
The following table shows which extensions are enabled by default and which can be enabled (PostgreSQL version 12):
Extension | Enabled | Version | Description |
---|---|---|---|
Note: With select * from pg_available_extensions;
you will see more available extensions, but many of them can't be enabled or used without superuser rights and thus aren't listed here.
You can migrate your existing databases over to DBaaS using the pg_dump
, pg_restore
and psql
tools.
To dump a database use the following command:
The -t <tablename>
flag is optional and can be added if you only want to dump a single table.
This command will create a script file containing all instructions to recreate your database. It is the most portable format available. To restore it, simply feed it into psql
. The database to restore to has to already exist.
The flag -F c
is selecting the custom archive format. For more information, see .
To restore from a custom format archive you have to use pg_restore
. The following command assumes that the database to be restored already exists.
When specifying the -C
parameter, pg_restore
can be instructed to recreate the database for you. For this to work you will need to specify a database that already exists. This database is used for initially connecting to and creating the new database. In this example we will use the database "postgres", which is the default database that should exist in every PostgreSQL cluster. The name of the database to restore to will be read from the archive.
Large databases can be restored concurrently by adding the -j <number>
parameter and specifying the number of jobs to run concurrently.
Note: The use of pg_dumpall
is not possible because it requires a superuser role to work correctly. Superuser roles are not obtainable on managed databases.
The logs that are generated by a database are stored temporarily on the same disk as the database. We provide logs for connections, disconnections, waiting for locks, DDL statements, any statement that ran for at least 500 ms, and any statement that caused an error (see postgreSQL ). Currently, we do not provide an option to change this configuration.
In order to conserve disk space, log files are rotated according to size. Logs should not consume more than 175 MB of disk storage. The files are continuously monitored and log messages are shipped to a central storage location with a retention policy of 30 days.
By using your cluster ID, you can fetch the logs for that cluster via our API.
The endpoint for fetching logs has four optional query parameters:
Parameter | Description | Default value | Possible values |
---|
So if you omit all parameters, you get the latest 100 log lines.
The response will contain the logs separated per instance and look similar to this (of course with different timestamps, log contents etc):
Header | Required | Type | Description |
---|---|---|---|
For more information on pg_restore
see the .
Authorization
yes
string
HTTP Basic authorization. A base64 encoded string of a username and password separated by a colon. username@domain.tld:password
X-Contract-Number
no
integer
Users with more than one contract may apply this header to indicate the applicable contract.
Content-Type
yes
string
Set this to application/json
.
plpython3u
X
1.0
PL/Python3U untrusted procedural language
pg_stat_statements
X
1.7
track execution statistics of all SQL statements executed
intarray
1.2
functions, operators, and index support for 1-D arrays of integers
pg_trgm
1.4
text similarity measurement and index searching based on trigrams
pg_cron
1.3
Job scheduler for PostgreSQL
set_user
3.0
similar to SET ROLE but with added logging
timescaledb
2.4.2
Enables scalable inserts and complex queries for time-series data
tablefunc
1.0
functions that manipulate whole tables, including crosstab
pg_auth_mon
X
1.1
monitor connection attempts per user
plpgsql
X
1.0
PL/pgSQL procedural language
pg_partman
4.5.1
Extension to manage partitioned tables by time or ID
hypopg
1.1.4
Hypothetical indexes for PostgreSQL
postgres_fdw
X
1.0
foreign-data wrapper for remote PostgreSQL servers
btree_gin
1.3
support for indexing common datatypes in GIN
pg_stat_kcache
X
2.2.0
Kernel statistics gathering
citext
1.6
data type for case-insensitive character strings
pgcrypto
1.3
cryptographic functions
earthdistance
1.1
calculate great-circle distances on the surface of the Earth
postgis
3.2.1
PostGIS geometry and geography spatial types and functions
cube
1.4
data type for multidimensional cubes
start | Retrieve log lines after this timestamp (format: RCF3339) | 30 days ago | between 30 days ago and now (before end) |
end | Retrieve log line before this timestamp (format: RFC3339) | now | between 30 days ago and now (after start) |
direction | Direction in which the logs are sorted and limited | BACKWARD | BACKWARD or FORWARD |
limit | Maximum number of log lines to retrieve. Which log lines are cut depends on direction | 100 | between 1 and 5000 |
To set up a database inside an existing datacenter, you should have at least one server in a private LAN.
You need to choose an IP address, under which the database leader should be made available.
There is currently no IP address management for databases. If you use your own subnet, you may use any IP address in that subnet. If you rely on DHCP for your servers, then you must pick an IP address of the subnet that is assigned to you by IONOS.
To find the subnet you can look at the NIC configuration. To prevent a collision with the DHCP IP range, pick an IP between x.x.x.3/24
and x.x.x.10/24
(which are never assigned by DHCP).
Caution: The deletion of a LAN with an attached database is forbidden. A special label deleteprotected
will be attached to the LAN. If you want to delete the LAN, either attach the database to a different LAN (via PATCH
request to update the database) or delete the database.
Alternatively, you can detach a database from the LAN to delete it. The database will remain disconnected.
CPU, RAM, storage, and number of database clusters are counted against quotas. Contact Resource usage to determine your RAM requirements.
Database performance depends on the storage type. Choose the storage type that is suitable for your workload.
The WAL files are stored alongside the database. The amount of WAL files can grow and shrink depending on your workload. Plan your storage size accordingly.
All database clusters are backed up automatically. You can choose the location where cluster backups are stored by providing the backupLocation
parameter as part of the cluster properties during cluster creation. When no backup location is provided it defaults to be the closest available location to your clusters' location. As of now, the backup location can't be changed after creation.
Note: Having the backup in the same location as your database increases the risk of data loss in case a whole location would experience a disaster. On the other hand chosing a remote location may impact the performance during node recreation.
This request will create a database cluster with two instances of PostgreSQL version 15.
Note: Only contract admins, owners, and users with "Access and manage DBaaS" privilege are allowed to create and manage databases. When a database is created it can be accessed in the specified LAN by using username and password specified during creation.
Note: This is the only opportunity to set the username and password via the API. The API does not provide a way to change the credentials yet. However, you can change them later by using raw SQL.
The datacenter must be provided as a UUID. The easiest way to retrieve the UUID is through the Cloud API.
Note: The sample UUID is 498ae72f-411f-11eb-9d07-046c59cc737e
Your values will differ from those in the sample code. Your response will have different IDs, timestamps etc.
At this point, you have created your first PostgreSQL cluster. The deployment of the database will take 20 to 30 minutes. You can check if the request was correctly executed.
Note that the state
will show as BUSY
Note: The sample UUID is 498ae72f-411f-11eb-9d07-046c59cc737e
You may have noticed that the state
is BUSY
and that the database is not yet reachable. This is because the cloud will create a completely new cluster and needs to provision new nodes for all the requested replicas. This process runs asynchronously in the background and might take up to 30 minutes.
The notification mechanism is not available yet. However, you can poll the API to see when the state
switches to AVAILABLE
.
To query a single cluster, you will require the id
from your "create" response.
If you don't know your PostgreSQL cluster ID, you can also list all clusters and look for the one for which to query the status.
Note: You cannot configure the port. Your cluster runs in the default port 5432.
Now that everything is set up and successfully created, you can connect to your PostgreSQL cluster. Initially, the cluster only contains one database, called postgres, to which you can connect. For example, using psql
and the credentials that you set in the POST request above you can connect with this:
Alternatively, you can also use the DNS Name returned in the response instead of the IP address. This record will also be updated when you change the IP address in the future:
This initial user is no superuser, for security reasons and to prevent conflicts with our management tooling. It only has CREATEDB and CREATEROLE, but not SUPERUSER, REPLICATION or BYPASSRLS (row level security) permissions (docs on role attributes).
The following roles are available to grant: cron_admin
, pg_monitor
, pg_read_all_stats
, and pg_stat_scan_tables
, see list of predefined roles.
Creating additional users, roles, databases, schemas, and other objects must be done by you yourself from inside SQL. Since this highly depends on your architecture, just some pointers:
The PUBLIC role is a special role, in the sense that all database users inherit these permissions. This is also important if you want to have a user without write permissions, since by default PUBLIC is allowed to write to the public
schema.
The official docs have a detailed walkthrough on how to manage databases.
If you want multiple user with the same permissions, you can group them in a role and GRANT the role to the users later.
For improved security you should only grant the required permissions. If you e.g. want to grant permission to a specific table, you also need to grant permissions to the schema:
To set the default privileges for new object in the future, see docs on ALTER DEFAULT PRIVILEGES.
Users are basically just roles with the LOGIN permission, so everything from above also applies.
Also see the docs on how to manage users.
Congratulations: You now have a ready to use PostgreSQL cluster!
This guide shows you how to connect to a database from your managed Kubernetes cluster.
We assume the following prerequisites:
A datacenter with id xyz-my-datacenter
.
A private LAN with id 3 using the network 10.1.1.0/24
.
A database connected to LAN 3 with IP 10.1.1.5/24
.
A Kubernetes cluster with id xyz-my-cluster
.
In this guide we use DHCP to assign IPs to node pools. Therefore, it is important that the database is in the same subnet that is used by the DHCP server.
To enable connectivity, you must connect the node pools to the private LAN in which the database is exposed:
Wait for the node pool to become available. To test the connectivity let's create a pod that contains the Postgres tool pg_isready
. If you have multiple node pools make sure to schedule the pod only the node pools that are attached to the additional LAN.
Let's create the pod...
... and attach to it.
If everything works, we should see that the database is accepting connections. If you see connection issues, make sure that the node is properly connected to the LAN. To debug the node start a debugging container ...
... and follow the network troubleshooting guide.
You can restore a database from a previous backup either in-place or to a different cluster.
Note: Choose the resources carefully for your new database cluster. The operation may fail if there is insufficient disk space or RAM. We recommend at least 4 GB of RAM for the new database, which can be scaled down after the restore operation.
To restore from a backup you will need to provide its ID. You can request a list of all available backups:
You can also list backups belonging to a specific cluster. For this, you need a clusterId
.
Our chosen clusterId
is: 498ae72f-411f-11eb-9d07-046c59cc737e
You can now trigger a restore of the chosen cluster. Your database will not be available during the restore operation.
The recoveryTargetTime
is an ISO-8601 timestamp that specifies the point in time up to which data will be restored. It is non-inclusive, meaning the recovery will stop right before this timestamp.
You should choose a backup with the most recent earliestRecoveryTargetTime
. However, this timestamp should be strictly less than the desirable recoveryTargetTime
. For example suppose you have three backups with earliestRecoveryTargetTime
from 1st, 2nd and 3rd of january 2022 at 0:00:00 espectively. If you want to restore to the recoveryTargetTime
2022-01-02T20:00:00Z
, you should use chose the backup from 2nd of january.
Note: To restore a cluster in-place you can only use backups from that cluster. If that backup is from an older Postgres version (after a major version upgrade), only the data is applied. The database will continue running the updated version.
Request
Response
The API will respond with a 202 Accepted
status code if the request is successful.
You can also create a new cluster as a copy from a backup by adding the fromBackup
field in your POST
request. You can use any backup from any cluster as long as the target cluster has the same or a more recent version of PostgreSQL.
The field takes the same arguments as shown above, backupId
and recoveryTargetTime
.
Note: A backup is a continuous process, so if you have any ongoing workload in your current cluster, do not expect the old data to appear instantly. If you wish to avoid a slight delay, you need to stop the workload prior to backing up.
If you want a new database to have all the data from the old one (clone database) use a backup with the most recent earliestRecoveryTargetTime
and omit recoveryTargetTime
from the POST
request.
Note: You can use the POST
and fromBackup
functionality to move a database to another region since the new database cluster doesn't need to be in the same region as the original one.
Request
If you're receiving errors like ERROR: permission denied for table x
, check that the permissions and owners are as you expect them.
PostgreSQL does have separate permissions and owners for each object (e.g. database, schema, table). Being the owner of the database only implies permissions to create objects in it, but does not grant any permissions on object in the database which are created by other users. For example, selecting data from a table in the database is permitted only when the user is the owner of the table or has been granted read privileges to it.
To show the owners and access privileges you can use this command. What each letter in access privileges stands for is documented in https://www.postgresql.org/docs/13/ddl-priv.html#PRIVILEGE-ABBREVS-TABLE
Include the output of this command if you open a support ticket related to permission problems.
If you see error messages like psql: error: could not connect to server: ...
, you can try to find the specific problem by executing these commands (on the client machine having the problems, assuming Linux):
To show local IP adresses:
Make sure that the IP address of the database cluster is NOT listed here. Otherwise this means that the IP address of the cluster collides with your local machines IP address. Make sure to select a non-DHCP IP address for the database cluster (between x.x.x.2/24
and x.x.x.10/24
).
To list the known network neighbors:
Make sure that the IP address of the database cluster shows up here and is not FAILED
. If it is missing: make sure that the database cluster is connected to the correct LAN in the correct datacenter.
Test that the database cluster IP is reachable:
This should show no package loss and rtt times should be around some milliseconds (may depend on your network setup).
To finally test the connection using the PostgreSQL protocol:
Some possible error messages are:
No route to host
: Can't connect on layer 3 (IP). Maybe incorrect LAN connection.
Connection refused
: Can reach the target, but it refuses to answer on this port. Could be that IP address is also used by another machine that has no PostgreSQL running.
password authentication failed for user "x"
: The password is incorrect.
If you're opening a support ticket, attach the output of the check-net-config.sh script, the output of psql -h $ip -U $user -d postgres
and the command showing your problem.
Under some circumstances, in-place restore might fail. This is because some SQL statements are not transactional (most notably DROP DATABASE
). A typical use case for in-place restore arises after the deletion of a database.
If a database is dropped, first, the data is removed from disk and then the database is removed from pg_database
. These two changes are not transactional. In this event, you will want to revert this change by restoring to a time before the drop was issued. Internally, Postgres replays all transactions until a transaction commits after the specified recovery target time. At this point all uncommitted transactions are aborted. However, the deletion of the database from disk cannot be inverted. As a result, the database is still listed in pg_database
but trying to connect to it results in the following:
DBaaS will perform some initialization on start-up. At this point the database will go into an error loop. To restore a database to a working state again, you can request another in-place restore with an earlier target time, such that at least one transaction is between recovery target time and the drop statement. The problem was previously discussed in the Postgres mailing list here.
Metrics can be retrieved via the Telemetry API as described below:
Request
Response
Follow MaaS documentation for more information on how to authenticate and available endpoints.
Once the PostgreSQL cluster is up and running, you can customize several attributes. For the first public release, you can alter the displayName
attribute. You can also arrange the maintenanceWindow
and change network connections
.
Note: The sample UUID is 498ae72f-411f-11eb-9d07-046c59cc737e
Quick Links: | Quick Links: |
---|---|
With the PATCH
request, you can change the name of your database cluster.
DBaaS supports upgrading Postgres to a higher major version in-place. To do so, simply issue a PATCH request containing the target Postgres version:
The upgrade procedure is efficient and should only take a few minutes (even for large databases). The database will be unavailable (potentially multiple times) until the upgrade is complete. Once the upgrade is done, the creation of a new backup is triggered.
Once the upgrade is triggered it cannot be undone. If the upgrade fails or causes unexpected behaviors for the application then the old state can be restored by creating a new database from the previous backup. A in-place restore will only apply the old data and not roll back to the older Postgres version.
Caution: Executing in-place upgrades drops objects and extensions from the database that could be incompatible with the new version. If you are unsure whether your application is affected by the changes then try the upgrade on a clone first.
DBaaS supports increasing the storage size of your cluster in-place. To do so, simply issue a PATCH request containing the new storage size:
The resizing happens online without interruptions.
Caution: Decreasing the storage size is not supported with this method.
DBaaS supports increasing and decreasing the size of your database instances. To do so, simply issue a PATCH request containing the new size (you can also specify only one of cores
or ram
, if you don't want to change both):
Caution: This change requires for the underlying nodes to be replaced and therefore will cause one failover.
DBaaS supports increasing and decreasing the amount of your database replicas. To do so, simply issue a PATCH request containing the new replica count (between 1 and 5):
Caution: Scaling down may cause one or more failovers and interrupt open connections.
If you do not provide a window during the creation of your database, a random window will be assigned for the database. You can update the window at any time, as shown in the example below.
When your cluster only contains one replica you might experience a short down-time during this maintenance window, while your database instance is being updated. In a replicated cluster, we only update standbys, but we might perform a switchover, in order to change the leader node.
After creating your database you can change the connection to your private LAN or temporarily remove it completely. You can change it to either be connected to a different LAN, or simply update the IP. However, you always have to include all properties of the connections
list for the request, even if you only want to update the database IP address. The newly provided LAN has to be in the same location as the database cluster. Updating the IP address also updates the record of the DNS name of the database.
Note: When you change the connection to a new LAN, the database will no longer be reachable in the old network almost immediately. However, the new connection will only be established, after your dedicated VMs are updated, which can take a couple of minutes, depending on the number of instances you specified.
In order to remove the connection, you have to specify an empty list in the request body:
Users (i.e. roles with LOGIN privileges) and databases can be created using the documented SQL commands. The API provides an alternative way to manage these objects.
Quick Links User Management: | Quick Links Database Management: |
---|---|
Each response from the API will include some standard attributes for metadata and pagination (for collections) which follow the IONOS API standards. Most of these will be omitted from the response examples for brevity.
If a resource is:
not created via the API, its createdBy
field ends with _unmanaged_
.
a read-only system resource, its createdBy
field ends with _system_
.
The endpoint for user management of a postgresql cluster is /users
.
A GET
request will give you a list of all users. Use the limit
and offset
parameters to control pagination.
Set the system
parameter to true
to view system users too. These users are required for administration purposes and cannot be changed or deleted.
A single user can be retrieved by their name using a GET
request.
With the POST
request, you can create a new user and set the login password.
The created user is returned.
Use a DELETE
request to remove a user. System users cannot be deleted.
The response body is empty.
With the PATCH
request, you can change the login password.
The updated user is returned. The password is never returned, though.
The endpoint for database management of a postgresql cluster is /databases
.
A GET
request will give you a list of all databases. Use the limit
and offset
parameters to control pagination.
A single database can be retrieved by its name using a GET
request.
Use a POST
request to create a new database. It must specify both the name and the owner.
The created database is returned.
Use a DELETE
request to remove a database.
The response body is empty.
As for now, DBaaS is only offered on Virtual Servers. Cloud Cubes may be used in the future as well.
IONOS DBaaS doesn't provide connection pooling. However, you may use a connection pooler (such as pgbouncer
) between your application and the database.
Depending on the library you are using, it should be something like:
failed to create DB connection: addr x.x.x.x:5432: connection refused.
The best way to manage connections is to have your application maintain a pool of at least 10-20 connections. It is considered bad practice to have a lot of DB connections. However, letting the user configure max_connections
themselves in the future is an option.
Yes, see for more info.
We provide an automated backup within our cloud. If you want to backup to somewhere else, you may use a client-side tool, such as .
The number of standby nodes (in addition to primary node) doesn’t really matter. If you have one or ten makes no difference. Synchronous modes are slower in write performance due to the increase in latency for communication between a primary node and a standby node.
If you are receiving an error message Parameter out of bounds: The recovery target time is before the newest basebackup.
, check the earliestRecoveryTargetTime
of your backup. Your target time of the restore needs to be after this timestamp. You can use an earlier earliestRecoveryTargetTime
backup for your cluster if you have one.
If the earliestRecoveryTargetTime
is missing in your backup, the cluster from where you want to restore wasn't able to do a base backup. This can happen, when you e.g. quickly delete a newly created cluster, since the base backup will be triggered up to a minute after the cluster is available.
Maintenance window is a weekly four-hour window. All changes that may cause service interruption (like upgrades) will be executed within the maintenance windows. During maintenance window, an uncontrolled disconnections and inability to connect to cluster can happen. Such disconnections are destructive for any ongoing transactions and also clients should reconnect.
Maintenance window consists of two parts. The first part specifies the day of the week, while the second part specifies the expected time. Here is an example of a maintenance window configuration:
For more information, see .
To guarantee partition tolerance, only odd numbers of cluster members are allowed. For the playground edition you can only have 1 replica. All other editions allow the use of 3 replicas. Soon we will allow more than 3 replicas per cluster.
The secondary instances are automatically highly available and replicate your data between instances. One instance is the primary, which accepts write transactions, and the others are secondary, which can optionally be used for read operations.
The instances in an IONOS MongoDB cluster are members of the same replica set, so all secondary instances replicate the data from the primary instance.
By default the write concern before acknowledging a write operations is set to "majority"
with j: true
. The term "majority"
means the write operation must be propagated to the majority of instances. In a three-instance cluster, for example, at least two instances must have the operation before the primary acknowledges it. The j
option also requires that the change has already been persisted to the on-disk journal of these instances.
If data is not replicated to the majority, it may be lost in the event of a primary instance failure and subsequent rollback.
You can change the write concern for single operations, for example due to performance reasons. For more information, see .
You can determine which instance to use for read operations by setting the read preference on the client side, if your client supports it. For more information, see .
If you read from the primary instance, you always get the most up-to-date data. You can spread the load by reading from secondary sources, but you might get stale data. However, you can get consistency guarantees using a .
MongoDB Backups: A cluster can have multiple snapshots. A snapshot is a copy of the data in the cluster at a certain time and is added during the following cases:
When a cluster is created, known as initial sync which usually happens in less than 24 hours.
After a restore.
Every 24 hours, a base snapshot is taken, and every Sunday, a full snapshot is taken.
Snapshots are retained for the last seven days; hence, recovery is possible for up to a week from the current date. You can restore from any snapshot as long as it was created with the same or older MongoDB patch version.
Snapshots are stored in an IONOS S3 Object Storage bucket in the same region as your database. Databases in regions where IONOS S3 Object Storage is not available is backed up to eu-central-2
.
Warning: If you destroy a MongoDB cluster, all of its snapshots are also deleted.
MongoDB Enterprise edition supports Offsite Backups, this allows backup data being stored in a location other than the deployed database cluster.
Available locations are de
, eu-south-2
, eu-central-2
.
Info: The location can only be set during cluster creation. Changes to the backup location of a provisioned cluster will result in unexpected behaviour.
Recovery is achieved via the restore jobs. A restore job is responsible to create and catalog a cluster restoration process. A valid snapshot reference is required for a restore job to recover the database. The API exposes available snapshots of a cluster.
There must be no other active restore job for the cluster to create a new one.
Warning: When restoring a database, it is advised to avoid connections to it until its restore job is complete and the cluster reaches AVAILABLE
state.
This feature is available only for enterprise clusters. The restoration of cluster here includes points in time and operations log (oplog) timestamps. A custom snapshot can be created for the exact oplog timestamp that you choose to restore the database cluster is possible with point in time recovery.
With IONOS Cloud MongoDB, you can quickly set up and manage MongoDB database clusters. It is an open-source, NoSQL database solution that offers document based storage, monitoring, encryption, and sharding. To provision to your workload use cases, IONOS provides MongoDB editions such as Playground, Business, and Enterprise models.
MongoDB is a widely used NoSQL database system that excels in performance, scalability, and flexibility, making it an excellent choice for managing large volumes of data. MongoDB offers different editions tailored to meet the requirements of enterprise-level deployments, namely MongoDB Business and MongoDB Enterprise editions. You can try out MongoDB for free with the MongoDB Playground edition and further upgrade to Business and Enterprise editions.
MongoDB Playground is a free edition that offers a platform to experience the capabilities of MongoDB with IONOS. It provides one playground instance for free and each additional instances created further are charged accordingly. You can prototype and learn how best the offering suits your enterprise.
MongoDB Business is a comprehensive edition that combines the power and flexibility of MongoDB with additional features and support to address the needs of businesses across various industries. It provides an all-in-one solution that enables organizations to efficiently manage their data, enhance productivity, and ensure the reliability of their applications.
MongoDB Enterprise is a powerful edition of the popular NoSQL database system, MongoDB, specifically designed to meet the demanding requirements of enterprise-level deployments. It offers a comprehensive set of features, advanced security capabilities, and professional support to ensure the optimal performance, scalability, and reliability of your database infrastructure.
IONOS DBaaS offers you a replicated MongoDB setup in minutes.
DBaaS is fully integrated into the . You may also manage it via automation tools like and .
Compatibility:
DBaaS currently supports MongoDB Playground versions 5.0 and 6.0.
DBaaS currently supports MongoDB Business versions 5.0 and 6.0.
DBaaS currently supports MongoDB Enterprise versions 5.0 and 6.0.
Locations:
Offered in the following locations: de/fra
, de/txl
, gb/lhr
, es/vit
, us/ewr
, us/mci
and fr/par
.
Offered in the following locations: de/fra
, de/txl
, gb/lhr
, es/vit
, us/ewr
, us/mci
and fr/par
.
Offered in the following locations: de/fra
, de/txl
, gb/lhr
, es/vit
, us/ewr
, us/las
, us/mci
and fr/par
.
The MongoDB Playground, MongoDB Business, and MongoDB Enterprise editions offer the following key capabilities:
Availability: Single instance database cluster with a small cube template availability.
Security: Communication between instances and between the client and the is protected with Transport Layer Security (TLS) using Let's Encrypt.
Resources: Cluster instances are dedicated Servers, with a dedicated CPU, storage, and RAM.
Backup: Backups are disabled for this edition. You need to upgrade to MongoDB Business or MongoDB Enterprise to avail database backup capabilities.
High availability: Multi-instance database clusters across different physical hosts with automatic data replication and failure handling.
Security: Communication between instances and between the client and the is protected with Transport Layer Security (TLS) using Let's Encrypt.
Management: Efficient monitoring and management are essential for maintaining the health and performance of MongoDB deployments. IONOS MongoDB Business Edition includes powerful monitoring and management tools to simplify these tasks. The MongoDB management enables centralized monitoring, proactive alerts, and automated backups, allowing businesses to efficiently monitor their clusters and safeguard their data.
Resources: Cluster instances are dedicated Servers, with a dedicated CPU, storage, and RAM. All data is stored on high-performance directly attached NVMe devices and encrypted at rest.
Backup: Daily snapshots are kept for up to seven days.
Restore: Databases can be restored from snapshots.
Shards: Supports horizontal scalability through , which allows for data to be distributed across multiple servers. For an example of how to create a sharded cluster, see .
Resources: Cluster instances are Virtual Servers with a boot and a data volume attached. The data volume is encrypted at rest.
BI Connector: The MongoDB Connector for BI allows you to query MongoDB data with SQL using tools such as Tableau, Power BI, and Excel. For an example of how to create a cluster with a BI Connector, see .
Network: Clusters can only be accessed via private LANs.
High availability: Multi-instance clusters across different physical hosts with automatic data replication and failure handling.
Security: Communication between instances and between the client and the cluster is protected with Transport Layer Security (TLS) using Let's Encrypt.
Backup: Daily snapshots are kept for up to seven days.
Restore: Databases can be restored from a specific snapshot given by its ID or restored from a point in time given by a timestamp.
Offsite Backup: Backup data is stored in a location other than the deployed database cluster.
Enterprise Support: With MongoDB Enterprise, you gain access to professional support from the MongoDB team ensuring that you receive timely assistance and expert guidance when needed. IONOS offers enterprise-grade Service Level Agreements (SLAs), guaranteeing rapid response times and 24/7 support to address any critical issues that may arise.
Note: IONOS Cloud does not allow full access to the MongoDB cluster. For example, due to security reasons, you cannot use all roles and need to create users via the IONOS API.
DBaaS services offered by IONOS Cloud:
Our platform is responsible for all back-end operations required to maintain your database in optimal operational health. The following services are offered:
Database management via the DCD or the DBaaS API.
Configuring default values, for example for data replication and security-related settings.
Automated backups for 7 days.
Regular patches and upgrades during the maintenance.
Disaster recovery via automated backup.
Service monitoring: both for the database and the underlying infrastructure.
Customer database administration duties:
Tasks related to the optimal health of the database remain the responsibility of the user. These include:
choosing adequate sizing,
data organization,
creation of indexes,
updating statistics, and
consultation of access plans to optimize queries.
Cluster: The whole MongoDB cluster is currently equal to the replica set.
Instance: A single server or replica set member inside a MongoDB cluster.
Name | Labels | Description |
---|---|---|
For more information on restoring database from backup by using the Cloud API, see .
ionos_dbaas_postgres_connections_count
contract_number, instance, postgres_cluster, role, state
Number of connections per instance and state. The state is one of the following: active, disabled, fastpath function call, idle, idle in transaction, idle in transaction (aborted).
ionos_dbaas_postgres_cpu_rate5m
contract_number, instance, postgres_cluster, role
The average CPU utilization over the past 5 minutes.
ionos_dbaas_postgres_disk_io_time_weighted_seconds_rate5m
contract_number, instance, postgres_cluster, role
The rate of disk I/O time, in seconds, over a five-minute period. Provides insight into performance of a disk, as high values may indicate that the disk is being overused or is experiencing performance issues.
ionos_dbaas_postgres_instance_count
contract_number, instance, postgres_cluster, role
Desired number of instances. The number of currently ready and running instances may be different. ionos_dbaas_postgres_role provides information about running instances split by role.
ionos_dbaas_postgres_load5
contract_number, instance, postgres_cluster, role
Linux load average for the last 5 minutes. This metric is represented as a number between 0 and 1 (can be greater than 1 on multicore machines), where 0 indicates that the CPU core is idle and 1 indicates that the CPU core is fully utilized. Higher values may indicate that the system is experiencing performance issues or is approaching capacity.
ionos_dbaas_postgres_memory_available_bytes
contract_number, instance, postgres_cluster, role
Available memory in bytes.
ionos_dbaas_postgres_memory_total_bytes
contract_number, instance, postgres_cluster, role
Total memory of the underlying machine in bytes. Some of it is used for our management and monitoring tools and not available to PostgreSQL. During horizontal scaling you might see different values for each instance.
ionos_dbaas_postgres_role
contract_number, instance, postgres_cluster, role
Current role of the instance. Provides whether an instance is currently "master" or "replica".
ionos_dbaas_postgres_storage_available_bytes
contract_number, instance, postgres_cluster, role
Free available disk space per instance in bytes.
ionos_dbaas_postgres_storage_total_bytes
contract_number, instance, postgres_cluster, role
Total disk space per instance in bytes. During horizontal scaling you might see different values for each instance.
ionos_dbaas_postgres_transactions:rate2m
contract_number, datid, datname, instance, postgres_cluster, role
Per-second average rate of SQL transactions (that have been committed), calculated over the last 2 minutes.
ionos_dbaas_postgres_user_tables_idx_scan
contract_number, datname, instance, postgres_cluster, relname, role, schemaname
Number of index scans per table/schema.
ionos_dbaas_postgres_user_tables_seq_scan
contract_number, datname, instance, postgres_cluster, relname, role, schemaname
Number of sequential scans per table/schema. A high number of sequential scans may indicate that an index should be added to improve performance.
Note: Currently, DBaaS - MongoDB does not support scaling existing clusters.
The WiredTiger cache uses only a part of the RAM; the remainder is available for other system services and MongoDB calculations. The size of the RAM used for caching is calculated as 50% of (RAM size - 1 GB)
with a minimum of 256 MB. For example, a 1 GB RAM instance uses 256 MB, a 2 GB RAM instance uses 512 MB, a 4 GB instance uses 1.5 GB, and so on.
You get the best performance if your working set fits into the cache, but it is not required. The working set is the size of all indexes plus the size of all frequently accessed documents.
To view the size of all databases' indexes and documents, you can use a similar script as described in the MongoDB Atlas documentation. You must estimate what percentage of all documents are accessed at the same time based on your knowledge of the workload.
Additionally, each connection can use up to 1 MB of RAM that is not used by WiredTiger.
The disk contains:
OpLogs for the last 24 hours. The size of these depends on your workload. There is no upper limit, so they can grow quite large. But they are removed after 24 hours on their own.
The data itself. Operating systems and applications are kept separately outside the configured storage and are managed by IONOS.
Connection Limits: As each connection requires a separate thread, the number of connections is limited to 51200 connections.
CPU: The total upper limit for CPU cores depends on your quota. A single instance cannot exceed 31 cores.
RAM: The total upper limit for RAM depends on your quota. A single instance cannot exceed 230 GB.
Storage: The upper limit for storage size is 4 TB.
Backups: Storing cluster backups is limited to the last 7 days. Deleting a cluster also immediately removes all backups of it.
IP Ranges: The following IP ranges cannot be used with our MongoDB services:
172.16.0.0/12
192.168.230.0/24
From the DCD, you can create and manage MongoDB Clusters. In the DCD > Databases, you can view the resource allocation details for your user account that shows details of CPU Cores, RAM (in GB), and Storage data. In the MongoDB, you can create database clusters in the following editions: Playground, Business, and Enterprise. Each of these editions offer varied resource allocation templates and advanced features that you could choose from that suits your enterprise needs. For information on creating a MongoDB cluster via the DCD, see Set up a MongoDB Cluster.
Note: The Database Manager is available for contract administrators, owners, and users with Access and manage DBaaS privileges only. You can set the privilege via the DCD group privileges. For more information, see Assigning Privileges to Groups.
Learn how to create a MongoDB database cluster via the DCD. |
Learn how to create a MongoDB database cluster using the Cloud API. |
Learn how to create a Sharded MongoDB database cluster using the Cloud API. |
Learn how to manage an existing MongoDB cluster attributes such as renaming a database cluster, upgrading MongoDB version, scaling clusters, and so on by using the Cloud API. |
Learn how to enable the BI connector for an existing MongoDB cluster by using the Cloud API. |
Learn how to manage user addition, user deletion, and manage user roles to a MongoDB cluster by using the Cloud API. |
Learn how to access MongoDB instance logs via the Cloud API. |
Learn how to migrate MongoDB data from one cluster to another via the Cloud API. |
Learn how to restore a database cluster either from cluster snapshots or from a backup in-place by using the Cloud API. |
Learn how to use Managed Kubernetes cluster to connect to a MongoDB cluster by using the Cloud API. |
The Cloud API lets you manage MongoDB database clusters programmatically by using the conventional HTTP requests. The creation of MongoDB cluster functionality that is available in the IONOS Cloud DCD is also available through the API.
You can also use the Cloud API to perform the following actions: modify cluster attributes, create sharded clusters, enable the BI connector, manage user access to clusters, access logs, migration of databases, and restore a database cluster.
Endpoint: https://api.ionos.com/databases/mongodb
To make authenticated requests to the API, you need to include a few fields in the request headers. Following are the relevant request parameters and descriptions:
Header | Required | Type | Description |
---|---|---|---|
We use curl
in our examples, as this tool is available on Windows 10, Linux and macOS. Please refer to our blogpost about curl
on Windows if you encounter any problems:
You can restore a MongoDB cluster by using a snapshot reference. A cluster can have multiple snapshots for backup and are retained for seven days; hence, cluster recovery is possible for up to a week from the current date. For more information, see Backup and Recovery.
MongoDB database cluster backups are available only in the following editions: MongoDB Business and MongoDB Enterprise.
Note: Backups are disabled for the Playground edition.
Note: All the available MongoDB clusters that are part of your contract are listed under the MongoDB Clusters section on the Databases page.
1. In the Data Center Designer, click the Databases menu.
2. In the Databases page under the MongoDB Clusters section, click the database cluster that is added for the Business edition.
3. In the Snapshots section, choose the snapshot you want to use for restoring the database cluster from the list of available snapshots.
Note: Each snapshot displays the following details:
Version: The MongoDB version number of the database cluster.
Created: A date and time when the database snapshot was created. For more information on instances when the snapshots are added, see Backups.
Size: Snapshot database cluster size (in MB).
4. Click Restore on the snapshot selected for restoring the data in the cluster.
5. Confirm the database restore from the snapshot by entering your password and clicking Yes, I'm sure.
Result: The database restore from the selected snapshot is successfully initiated.
Note:
The operation of database restore from the snapshot cannot be undone once confirmed. For more information, see Backup and Recovery.
You cannot initiate a new database restore of a cluster from a snapshot when a restore is already in progress.
1. In the Data Center Designer, click the Databases menu.
2. In the Databases page under the MongoDB Clusters section, click the database cluster that is added for the Enterprise edition.
3. In the Snapshots section, choose from the following two options to restore a database cluster:
1. Restore by time: Restores the database cluster from a specific point-in-time of the database backup.
Choose the backup time from the calendar displayed and click Save. The number of hours in the past from which the backup is possible is between 1 and 24 hours. The default value is 24 hours.
Confirm the database restore from the snapshot by entering your password and clicking Yes, I'm sure.
2. Restore: Choose the snapshot you want to use for restoring the database cluster from the list of available snapshots.
Click Restore.
Confirm the database restore from the snapshot by entering your password and clicking Yes, I'm sure.
Note: Each snapshot displays the following details:
Version: The MongoDB version number of the database cluster.
Created: A date and time when the database snapshot was created. For more information on instances when the snapshots are added, see Backups.
Size: Snapshot database cluster size (in MB).
Result: The database restore from the selected snapshot is successfully initiated.
Note:
The operation of database restore from the snapshot cannot be undone once confirmed. For more information, see Backup and Recovery.
You cannot initiate a new database restore of a cluster from a snapshot when a restore is already in progress.
You can add a MongoDB cluster on any of the following editions: Playground, Business, or Enterprise.
Prerequisites: Before setting up a database, make sure you are working within a provisioned VDC that contains at least one virtual machine (VM) from which to access the database. The VM you create is counted against the quota allocated in your contract. For more information on databases quota, see Resource Allocation.
Note: Database Manager is available for contract administrators, owners, and users with Access and manage DBaaS privileges only. You can set the privilege via the DCD group privileges.
1. In the Data Center Designer, click the Databases menu.
2. In the Databases page, click + Add in the MongoDB Clusters section.
3. Provide an appropriate Display Name.
4. From the drop-down list, choose a Location where your data for the database cluster can be stored. You can select an available data center within the cluster's data directory to create your cluster.
5. Choose the Edition type as Playground. In this edition, you can create one playground instance for free and test MongoDB.
Note: For every additional instance that you create apart from the first instance, the charges are applicable accordingly.
6. Select the Template to use the resources for creating your MongoDB cluster. In the Playground edition, the following standard resources are available:
RAM Size (GB): 2.
vCPU: 1.
Storage Size: 50 GB.
7. Select the Database Type as the Replica Set. This database type maintains replicas of data sets and offers redundancy and high data availability.
Note: The Sharded Cluster database type is not available for selection in the Playground edition.
8. Select the Instances to host a logical database manager environment to catalog your databases. By default, one instance is offered for free in this edition.
Note: The Estimated price will be displayed based on the input. The estimated cost is exclusive, where certain variables like traffic and backup are not considered.
9. In the Cluster to Datacenter Connection section, set up the following:
Select a Data Center: Select a data center from the available list. Use the search option to enter a data center that you want to select.
LAN in the selected Datacenter: Select a LAN for the chosen data center.
10. In the Private IP/Subnet, perform the following actions:
Private IP/Subnet: Enter the private IP or subnet address in the correct format by using the available Private IPs.
Note: To know your private IP address/Subnet, you need to:
Create a single server connected to an empty private LAN and check the IP assigned to that NIC in that LAN. The DHCP in that LAN is always using a /24 subnet, so you have to reuse the first 3 IP blocks to reach your database.
To prevent a collision with the DHCP IP range, it is recommended to use IP addresses ending between x.x.x.3/24 and x.x.x.10/24 (which are never assigned by DHCP).
If you have disabled DHCP on your private LAN, then you need to discover the IP address on your own.
Click Add to save the private IP/Subnet address details.
Click Add Connection to connect the cluster to the data center.
11. Select the appropriate MongoDB Version. The IONOS Database Manager supports 5.0 and 6.0 MongoDB versions.
12. In the Maintenance Window, set the following:
Maintenance time: Set the time (in UTC) for the maintenance of the MongoDB cluster. Use the pre-defined format (hh:mm:ss) or you can use the clock. The maintenance occurs in a 4-hour-long window, adjust the time accordingly.
Maintenance day: From the dropdown menu, choose the preferred day on which the maintenance of the cluster must take place.
13. Click Save to provision the creation of the MongoDB cluster.
Result: The MongoDB cluster for the defined values is created in the Playground edition.
1. In the Data Center Designer, click the Databases menu.
2. In the Databases page, click + Add in the MongoDB Clusters section.
3. Provide an appropriate Display Name.
4. From the drop-down list, choose a Location where your data for the database cluster can be stored. You can select an available data center within the cluster's data directory to create your cluster.
5. Choose the Edition type as Business.
6. Select the Template to use the resources needed for creating your MongoDB cluster. In the Business edition, the resources varying from MongoDB Business XS to MongoDB Business 4XL_S are made available. Each template differs based on the RAM Size (GB), vCPU, and Storage Size.
Note: Depending on the resource limit allocation as per your contract, some of the templates may not be available for selection.
7. Select the Database Type as the Replica Set. This database type maintains replicas of data sets and offers redundancy and high availability of data.
Note: The Sharded Cluster database type is not available for selection in the Business edition.
8. Choose the Instances to host a logical database manager environment to catalog your databases. By default, one instance and three instances are possible in the Business edition.
Note: The Estimated price will be displayed based on the input. The estimated cost is exclusive, where certain variables like traffic and backup are not considered.
9. In the Cluster to Datacenter Connection section, set up the following:
Select a Data Center: Select a data center from the available list. Use the search option to enter a data center that you want to select.
LAN in the selected Datacenter: Select a LAN for your data center.
10. In the Private IP/Subnet, perform the following actions:
Private IP/Subnet: Enter the private IP or subnet address in the correct format by using the available Private IPs. Depending on the number of instances selected in step 8, you need to enter one private IP/Subnet address detail for every instance.
Note: To know your private IP address/Subnet, you need to:
Create a single server connected to an empty private LAN and check the IP assigned to that NIC in that LAN. The DHCP in that LAN is always using a /24 subnet, so you have to reuse the first 3 IP blocks to reach your database.
To prevent a collision with the DHCP IP range, it is recommended to use IP addresses ending between x.x.x.3/24 and x.x.x.10/24 (which are never assigned by DHCP).
If you have disabled DHCP on your private LAN, then you need to discover the IP address on your own.
Click Add to save the private IP/Subnet address details.
Click Add Connection to connect the cluster to the data center.
11. Select the appropriate MongoDB Version. The IONOS Database Manager supports 5.0 and 6.0 MongoDB versions.
12. In the Maintenance Window, set the following:
Maintenance time: Set the time (in UTC) for the maintenance of the MongoDB cluster. Use the pre-defined format (hh:mm:ss) or you can use the clock. The maintenance occurs in a 4-hour-long window, adjust the time accordingly.
Maintenance day: From the dropdown menu, choose the preferred day on which the maintenance of the cluster must take place.
13. Click Save to provision the creation of the MongoDB cluster.
Result: The MongoDB cluster for the defined values is created in the Business edition.
1. In the DCD, click the Databases menu.
2. In the Databases page, click + Add in the MongoDB Clusters section.
3. Provide an appropriate Display Name.
4. From the drop-down list, choose a Location where your data for the database cluster can be stored. You can select an available data center within the cluster's data directory to create your cluster.
5. Choose the Edition type as Enterprise.
6. Choose the following resources for creating each node of your MongoDB cluster. The total billed resources will be these values multiplied by the number of instances and the number of shards (if applicable).
CPU Cores: You can choose between 1 and 31 CPU cores using the slider or choose from the available shortcut values.
RAM Size (GB): Values of up to 230 GB RAM sizes are possible. Select the RAM size using the slider or choose from the available shortcut values.
Storage Size: Set the storage size value to at least 100 GB in case of SSD Standard and Premium storage types for optimal performance of the database cluster. You can configure the storage size to a maximum of 4 TB.
7. Select the Database Type from the following:
Replica Set: Maintains replicas of datasets; offers redundancy and high availability of data.
Sharded Cluster: Maintains collection of datasets that are distributed across many shards (servers) and hence offers horizontal scalability. Define the Amount of Shards between two to a maximum of thirty-two shards.
Note: For sharded clusters, an additional three config server instances are created with sizing of two cores, 4 GB of memory, and 40 GB of storage each. These instances are excluded from the billed resources.
8. Choose the Instances to host a logical database manager environment to catalog your databases. By default, three instances are possible in the Enterprise edition.
Note: The Estimated price will be displayed based on the input. The estimated cost is exclusive, where certain variables like traffic and backup are not considered.
9. In the Cluster to Datacenter Connection section, set up the following:
Select a Data Center: Select a data center from the available list. Use the search option to enter a data center that you want to select.
LAN in the selected Datacenter: Select a LAN for your data center.
10. In the Private IP/Subnet, perform the following actions:
Private IP/Subnet: Enter the private IP or subnet address in the correct format by using the available Private IPs. Depending on the number of instances selected in step 8, you need to enter one private IP/Subnet address detail for every instance.
Note: To know your private IP address/Subnet, you need to:
Create a single server connected to an empty private LAN and check the IP assigned to that NIC in that LAN. The DHCP in that LAN is always using a /24 subnet, so you have to reuse the first 3 IP blocks to reach your database.
To prevent a collision with the DHCP IP range, it is recommended to use IP addresses ending between x.x.x.3/24 and x.x.x.10/24 (which are never assigned by DHCP).
If you have disabled DHCP on your private LAN, then you need to discover the IP address on your own.
Click Add to save the private IP/Subnet address details.
Click Add Connection to connect the cluster to the data center.
11. Select the appropriate MongoDB Version. The IONOS Database Manager supports 5.0 and 6.0 MongoDB versions.
12. Choose a Backup Location that is explicitly the location of your backup (region). You can have off-site backups by using a region that is not included in your database region.
13. Toggle on the Enable BI Connector to enable the MongoDB Connector for Business Intelligence (BI) to query a MongoDB database by using SQL commands to aid in the data analysis. If you do not want to use BI Connector, you can toggle off this setting.
14. In the Maintenance Window, set the following:
Maintenance time: Set the time (in UTC) for the maintenance of the MongoDB cluster. Use the pre-defined format (hh:mm:ss) or you can use the clock. The maintenance occurs in a 4-hour-long window, adjust the time accordingly.
Maintenance day: From the dropdown menu, choose the preferred day on which the maintenance of the cluster must take place.
15. Click Save to provision the creation of the MongoDB cluster.
Result: The MongoDB cluster for the defined values is created in the Enterprise edition.
You can update an existing MongoDB cluster on any of the following editions: Playground, Business, or Enterprise.
Prerequisites: Make sure the MongoDB database cluster is added by following the steps in Set up a MongoDB Cluster.
Note: All the available MongoDB clusters that are part of your contract are listed under the MongoDB Clusters section on the Databases page.
1. In the Data Center Designer, click the Databases menu.
2. In the Databases page under the MongoDB Clusters section, click the database cluster that is added for the Playground edition.
Note: From this page, you can perform the following actions: Copy connection URI and User Management .
4. In the Edit Form, you can update the following cluster details:
Display Name: Edit the name of the MongoDB cluster.
Edition: You can upgrade the existing cluster edition from Playground to either Business or Enterprise.
Template: Based on the edition selected, choose from the list of templates you want to update the cluster with.
Instances: Depending on the edition and template selected, you would see the allowed number of instances you could choose from. For example, if the existing cluster is updated to Business edition and a MongoDB Business S template is selected, then, you could choose to edit the number of instances to either one or three instances.
Note: The Estimated price will be displayed based on the input. The estimated cost is exclusive, where certain variables like traffic and backup are not considered.
Delete an existing IP address.
Add new Private IP/Subnet List.
6. In the Maintenance Window, you can edit the following details:
Maintenance time: Choose the appropriate time from the clock displayed.
Maintenance day: From the dropdown list, modify the preferred day on which the maintenance of the cluster must take place.
7. Click Save to provision your changes.
Result: The existing MongoDB cluster is updated with the newly defined values. You can review the updated cluster details under the Properties section.
Next steps: In editing a cluster, you can also perform the following actions:
In the User Management section, click Add to create and manage user roles for the MongoDB cluster. For more information, see Roles.
Note: Database snapshots are not available for clusters in the Playground edition. For more information, see Features.
1. In the Data Center Designer, click the Databases menu.
2. In the Databases page under the MongoDB Clusters section, click the database cluster that is added for the Business edition.
4. In the Edit Form, you can update the following cluster details:
Display Name: Edit the name of the MongoDB cluster.
Edition: You can upgrade the existing cluster edition from Business to Enterprise.
Template: Based on the edition selected, choose from the list of templates you want to update the cluster with.
Instances: Depending on the edition and template selected, you would see the allowed number of instances you could choose from. For example, if the existing cluster is updated to Business edition and a MongoDB Business L template is selected, then, you could choose to edit the instances to either one or three instances.
Note: The Estimated price will be displayed based on the input. The estimated cost is exclusive, where certain variables like traffic and backup are not considered.
Delete an existing IP address.
Add new Private IP/Subnet List.
6. In the Maintenance Window, you can edit the following details:
Maintenance time: Choose the appropriate time from the clock displayed.
Maintenance day: From the dropdown list, modify the preferred day on which the maintenance of the cluster must take place.
7. Click Save to provision your changes.
Result: The existing MongoDB cluster is updated with the newly defined values. You can review the updated cluster details under the Properties section.
Next steps: In editing a cluster, you can also perform the following actions:
In the User Management section, click Add to create and manage user roles for the MongoDB cluster. For more information, see Roles.
In the Snapshots section, restore the data in the cluster from the selected snapshot. For more information, see Restore a MongoDB Cluster via the DCD.
Note: When you delete a cluster, all of its backup data is also immediately deleted.
1. In the Data Center Designer, click the Databases menu.
2. In the Databases page, click the database cluster that is added for the Enterprise edition.
4. In the Edit Form, you can update the following cluster details:
Display Name: Edit the name of the MongoDB cluster.
Edition: You can only view the existing cluster edition set as Enterprise.
Note: At this time, it is not possible to downgrade from the Enterprise edition to any other edition.
CPU Cores: Update the number of CPU cores between 1 and 31 cores using the slider or choose from the available shortcut values.
RAM Size (GB): Update RAM size for up to 230 GB is possible. Select the RAM size using the slider or choose from the available shortcut values.
Instances: Choose from three, five, or seven instances to host a logical database manager environment to catalog your databases.
Note: At this time, downscaling of instances is not supported.
Note: The Estimated price will be displayed based on the input. The estimated cost is exclusive, where certain variables like traffic and backup are not considered.
Delete an existing IP address.
Add new Private IP/Subnet List.
6. Toggle on or off the Enable BI Connector. It is advised to enable the MongoDB Connector for Business Intelligence (BI) to query a MongoDB database by using SQL commands to aid in the data analysis.
7. Update the offsite Backup Location to allow backup data to be stored in a location other than the deployed database cluster. Available backup locations: de
, eu-south-2
, eu-central-2
.
8. In the Maintenance Window, you can edit the following details:
Maintenance time: Choose the appropriate time from the clock displayed.
Maintenance day: From the dropdown list, modify the preferred day on which the maintenance of the cluster must take place.
9. Click Save to provision your changes.
Result: The existing MongoDB cluster is updated with the newly defined values. You can review the updated cluster details under the Properties section.
Next steps: In editing a cluster, you can also perform the following actions:
In the User Management section, click Add to create and manage user roles for the MongoDB cluster. For more information, see Roles.
In the Snapshots section, restore the data in the cluster from the selected snapshot. For more information, see Restore a MongoDB Cluster via the DCD.
Note: When you delete a cluster, all of its backup data is also immediately deleted.
This section shows you how to enable the BI Connector on an existing cluster.
Note: This feature is only available for enterprise clusters.
The BI Connector is enabled by modifying a cluster attribute with a PATCH request.
Set biConnector.enabled
to true
to enable the BI Connector for this cluster.
You can disable it at any time by setting this attribute to false
again.
Note: Only contract administrators and owners can create and change database clusters. In contrast, the running database cluster can be accessed from all servers in the specified LAN.
In the following example, a random value 498ae72f-411f-11eb-9d07-046c59cc737e is used as the cluster ID.
200 Successful operation
The patched resource is returned.
The biConnector
property now includes the host
and port
attributes needed to connect to the BI Connector. These are read-only attributes and cannot be changed.
At this point, you have enabled the BI Connector on your database.
Note: After the BI Connector is enabled, it may take a few minutes until the connector is ready for connections.
This section shows you how to create a MongoDB sharded cluster using the IONOS API. This feature is available only for enterprise clusters.
For information about prerequisites to retrieve the data center UUID, query database status, connect to the cluster, and prepare the network, see .
This request creates a MongoDB version 6.0 sharded database cluster of two shards with three replicas each. The size of each node is specified in the request.
Note: The use of shards
in the request identifies the number of shards, while type
defines the cluster as a sharded cluster.
Note: Only contract administrators and owners can create and change database clusters. In contrast, the running database cluster can be accessed from all servers in the specified LAN.
In total, six database nodes are created, and consequently, the number of billed resources is 24 cores, 12 GB memory, and 120 GB storage.
Note: In addition, a set of three config servers is created with two cores, 4 GB memory, and 40 GB storage each. These are excluded from the billed resources.
Note: We will use 498ae72f-411f-11eb-9d07-046c59cc737e as example for the cluster ID in following examples.
Every running MongoDB instance collects logs from MongoD. Currently, there is no option to change this configuration. The log messages are shipped to a central storage location with a retention policy of 30 days.
Using the cluster ID, you can access the logs for that cluster via the API.
The endpoint for fetching logs has four optional query parameters:
Parameter | Description | Default value | Possible values |
---|
If you omit all parameters, you will get the most recent 100 log messages.
The following example shows how to receive only the first two messages after 12:00 a.m. on January 5, 2022:
The response contains the log messages separated per instance and looks similar to this:
For MongoDB clusters, you have to manage users via the IONOS API and creating users inside the database is not possible. This document shows you in detail how to create, view, and delete users.
In MongoDB most roles are scoped to a database. For example you grant readWrite
permissions on database mydb
. The exception are roles that grant permissions to all databases, for example .
Assignable roles have several restrictions to avoid customers breaking out of their database or breaking internal stuff:
Currently, you can only assign . Out of those currently only read
, readWrite
, readAnyDatabase
, readWriteAnyDatabase
, dbAdmin
, dbAdminAnyDatabase
and clusterMonitor
are supported.
Roles with the suffix *AnyDatabase
are granted only on the admin
database, which is the main user management database.
Roles read
, readWrite
and dbAdmin
cannot be granted on config
and local
databases.
When creating a user you need to consider the following:
All users are created in the admin
database.
The combination of username and database must be unique within the MongoDB cluster.
You can only change the assigned roles and the password of a user.
You can't have more than 100 users in a cluster.
To add users to a MongoDB cluster, use the POST request for each user.
To delete a user from MongoDB cluster, use the DELETE request as follows:
To get a list of all users defined in MongoDB cluster, use the GET request as follows:
To get a specific user in a MongoDB cluster, use the GET request as follows:
To update the password of a specific user in a MongoDB cluster, use the PATCH request as follows:
To update the assigned roles of a specific user in a MongoDB cluster, use the PATCH request with the new list of assigned roles. Note that the request replaces the old role list, meaning that any existing roles missing from the patch will be deleted.
IONOS MongoDB API allows you to create a MongoDB cluster.
In the following examples, we assume that you want to use the data center UUID b1432c51-c20a-4f83-876f-c3a8a9e1fbec
.
To list the available sizing templates using the API:
Request
Response
Currently, we do not support changing instance sizes for single instance clusters. You would need to create a new cluster for this.
For the following examples, we assume that you want to create a small test cluster and therefore chose the template 15c6dd2f-02d2-4987-b439-9a58dd59ecc3
.
CPU, RAM, storage, and storage type are provided and not limited by a set of predefined templates as in the business edition.
Currently, we don't support changing the cluster storage size for single instance clusters. You would need to create a new cluster to change the cluster storage size.
Currently, the database cluster does not have automatic IP address management, and the only supported subnet is /24. To create a MongoDB cluster, specify as many free IP addresses as the number of instances in your cluster. Make sure that the IP addresses are not used by other servers in your LAN. You can choose the IP address by using one of the following methods:
You can choose the IP addresses of the subnet assigned to you by IONOS if you rely on IONOS-provided DHCP. The Network Interface Card (NIC) configuration contains information about the subnet. To prevent a collision with the DHCP IP range, choose an IP address between x.x.x.3/24
and x.x.x.10/24
. The IONOS DHCP never assigns IP addresses in that range.
If you run your own DHCP, select IP addresses that cannot be assigned by your DHCP server.
If you assign IP addresses manually, you may use any IP addresses in that subnet and need to make sure that it is not used anywhere else.
For example, assume your private LAN uses the IP range 10.1.1.0/24
and you want a cluster with three instances. Then, you could provide us with the IP addresses 10.1.1.3/24
, 10.1.1.4/24
and 10.1.1.5/24
. Note that the prefix length (/24
) still is the same as for the whole subnet. We only use the single IPs that you specify, but we need the prefix length to configure routing correctly.
Warning: You cannot delete a LAN while a database cluster is still attached. If you want to delete the LAN, then first delete the database cluster.
This request creates a database cluster with three instances of MongoDB version 5.0.
Note: Only contract administrators and owners can create and change database clusters. In contrast, the running database cluster can be accessed from all servers in the specified LAN.
Request
Response
Note: We will use 498ae72f-411f-11eb-9d07-046c59cc737e as example for the cluster ID in following examples.
This request will create a database cluster with three instances of MongoDB version 6.0.
Note: The use of these enterprise attributes. edition
specifies an enterprise edition. cores
specifies the number of CPUs. ram
specifies the RAM amount in MB. storageSize
specifies the storage amount in MB. storageType
specifies the storage type. The possible values are HDD
, SSD Standard
, and SSD Premium
Note: Only contract administrators and owners can create and change database clusters. However, the running database cluster can be accessed from all servers in the specified LAN.
Request
Response
Note: In the following examples, we use 498ae72f-411f-11eb-9d07-046c59cc737e as the cluster ID.
You may have noticed that the state
is BUSY
and that the database cluster is unreachable. This is because the cloud creates a completely new cluster and needs to provision new instances. This process runs asynchronously in the background and might take several minutes.
You can poll the API to see when the state
switches to AVAILABLE
and health
to HEALTHY
meaning a fully functional cluster.
To query a single cluster, you require the id
from your "create" response.
If you do not know your MongoDB cluster-ID, you can also list all clusters and look for the one for which to query the status.
Now that the cluster is available, you can connect to your MongoDB cluster using the mongo shell tool and the connection string from the API response and should see the mongo shell prompt:
Reminder: The connection must be performed from an extra VM.
Connecting to a MongoDB cluster doesn't require authentication. However, nearly all other operations with a cluster require authentication. For example, when you try to list all databases:
Assume you have created a user jdoeionos
on database example
with the role readWrite
on example
. Then you can authenticate like this: and can afterward write and read data:
Result: You now have a ready-to-use MongoDB cluster.
Once the MongoDB cluster is up and running, you can customize several attributes.
With the PATCH
request, you can change the name of your database cluster.
Note: The sample UUID is d02de413-d5af-4104-a6f9-3a3c2766ee61
DBaaS supports MongoDB versions 5.0 and 6.0. We keep the MongoDB minor version up to date with the MongoDB's latest release for that major version.
Changing the version of a running MongoDB cluster via the API is not allowed.
To change the template, issue a PATCH
request containing the MongoDB Template ID:
Note: Be prepared for a possible downtime in case of a cluster with only one replica.
Note: Decreasing storageSize to a size lower than your consumed storage is not allowed.
MongoDB for the Enterprise Edition allow you to freely choose the amount of CPU, RAM and Storage for your cluster. Additionally, you can also choose between the following available StorageTypes: HDD
, SSD
and SSD Premium
.
Note: Decreasing storageSize to a size lower than your consumed storage is not allowed.
DBaaS allows you to scale up and down the number of database replicas. Increased replica count may result in a cluster with improved availability, performance (capacity to handle more data reads), and fault tolerance for upgrades. A new IP address must be provided for each new instance. To do so, send a PATCH
request with the new instances
count (supported values are: 1, 3):
The patch example takes a previous cluster with one replica and adds two more replicas to it. The two new IP addresses are added to the connection properties cidrList
, and the instances property receives the total number of replicas.
New servers are provisioned and added one at a time to the pool of replicas, implying an incremental rollout.
Downgrading a cluster follows the same pattern, with replica sets being removed one at a time and the desired replica set is reached.
Note: Only MongoDB Business edition provides an option to downscale the number of instances. Scaling down may result in one or more failovers and the disruption of open connections.
DBaaS allows you to increase the number of shards for MongoDB Enterprise sharded clusters. An increased shard count increases the overall storage of the cluster.
To increase the number of shards, send a PATCH
request with the new shards
count as shown in the following request:
Note: You can increase the number of shards to a maximum of 100.
The following is a sample response:
The PATCH
example modifies a previously created sharded cluster and sets the number of shards to three.
Note: Decreasing shards is currently not possible.
If you do not specify a maintenance window when creating your database, a random window is assigned. You can update the window at any time, as shown in the example.
If your cluster only has one replica, you may experience a brief outage while your database instance is being updated during this maintenance window. In a replicated cluster, secondaries are updated first and rolled out one by one; each rollout must be complete and healthy before the next one can begin.
Maintenance windows are used to update the cluster's MongoDB minor version. Other maintenance updates related to the cluster infrastructure and security might take place during a maintenance window.
3. Click edit to modify the cluster details for the selected database cluster.
5. In the Cluster to Datacenter Connection section, click edit to perform the following actions:
Delete an existing cluster by using the delete option .
Note: From this page, you can perform the following actions: Copy connection URI and User Management .
3. Click edit for the selected database cluster to modify the cluster details.
5. In the Cluster to Datacenter Connection section, click edit to perform the following actions:
Delete an existing cluster by using the delete option .
Note: From this page, you can perform the following actions: Copy connection URI and User Management .
3. Click edit for the selected database cluster to modify the cluster details.
5. In the Cluster to Datacenter Connection section, click edit to perform the following actions:
Delete an existing cluster by using the delete option .
At this point, you have created your first MongoDB sharded cluster. The deployment of the database takes several minutes. For more information about determining if your cluster is ready, see .
When the cluster is ready, add the role enableSharding
to a user in order to allow shard management capabilities. For managing user roles, see . Only users with enableSharding
role can shard a collection. For more information, see .
Choose the sizing that fits your use case and specify it on cluster creation. For more information about how to calculate resource usage, see .
CPU, RAM, storage, and the number of database clusters are counted against quotas. For more information about how to calculate resource usage, see .
Database performance depends on the storage type ( HDD
, SSD
and SSD Premium
). Choose the that is suitable for your workload.
At this point, you have created your first MongoDB cluster. The deployment of the database takes several minutes. To determine when your cluster is ready, see .
At this point, you have created your first MongoDB cluster. The deployment of the database takes several minutes. To determine when your cluster is ready, see .
You cannot create or modify users from within MongoDB itself. The user management for IONOS MongoDB clusters happens completely via the IONOS API. You can read more about this in the documentation on .
DBaaS allows you to scale up and down the size of your database instances. Database instance sizes are managed similarly to ; each template exposes a combination of resource sizes that can be assigned to any of your clusters.
Note: You can get a list of available .
The provisioning engine will delete a secondary replica and create a new server of the desired size. Once ready, it will replicate the existing data to this new server via the . During this procedure, the cluster should operate normally. When the provisioning engine identifies the new server is complete and healthy, it will continue the rollout for every remaining secondary replica up to the primary.
For more information, see .
Note: We recommend you to review the before adding shards.
New shards added this way are created by provisioning new servers and adding them to the sharded cluster. Each shard has the number of servers provided by the instances field. Sharded collections' data will then be distributed to the new shards. For more information, see .
The user management for IONOS MongoDB clusters happens completely via the IONOS API. Creation or modification of users from within MongoDB itself is not allowed. For more information, see .
Authorization
yes
string
HTTP Basic authorization. A base64 encoded string of a username and password separated by a colon. username@domain.tld:password
X-Contract-Number
no
integer
Users with more than one contract may apply this header to indicate the applicable contract.
Content-Type
yes
string
Set this to application/json
.
start | Retrieve log lines after this timestamp (format: RCF3339) | 30 days ago | between 30 days ago and now (before end) |
end | Retrieve log line before this timestamp (format: RFC3339) | now | between 30 days ago and now (after start) |
direction | Direction in which the logs are sorted and limited | BACKWARD | BACKWARD or FORWARD |
limit | Maximum number of log lines to retrieve. Which log lines are cut depends on direction | 100 | between 1 and 5000 |
This How-to shows you how to migrate your MongoDB data from one cluster to another one. For example how to migrate from your existing on-premise MongoDB cluster to the IONOS MongoDB cluster.
This migration requires some downtime, as you need to stop write operations to your old cluster during dumping the data.
The steps for a migration are as follows:
Preparations
Stop writes to old cluster - start of downtime
Dump data from old cluster using mongodump
Optionally: copy dump
Restore data into new cluster using mongorestore
Use the new cluster - end of downtime
mongodump
and mongorestore
You need one machine that can access the old cluster, that can run mongodump
, and one machine that can access the new cluster, that can run mongorestore
.
Both can happen on the same machine. If they're two different machines, you need a way to copy the data dump from one machine to the other.
Both clusters need to be running the same major version. You can see the version in the greeting if you connect with mongosh
or you can query it with db.version()
.
If your old cluster has access control enabled, you need a user with permissions for find
to all databases. Easiest is to grant the backup
role to the user that you want to use for dumping the data.
You can then verify that you can connect by using the command for mongodump
mentioned in the section "Dump old data" and then aborting the dump with Ctrl-C.
You need one user with write permissions to all databases that your dump contains.
Additionally you can't restore the users and roles via mongorestore
. So you have to create all the users with their credentials and roles via the IONOS API. You can list all the users and roles in your old cluster with db.system.users.find()
in the admin
database and can then create them in the new cluster according to the documentation on User Management. You can't see the plain text password on your old cluster, so you need to collect them from wherever you stored them.
Caution: The use of --oplog
isn't possible because it requires elevated privileges on restoring. Therefore you need to make sure that no write operations happen during the dump. Otherwise you get an inconsistent dump.
You can dump the data from the old cluster with this command:
Optionally you can limit data using --db, --collection, or --query flags to only dump specific databases, collections, or documents.
You can restore the dumped date in the new cluster with this command:
admin.system.*
resources are excluded, since you can't modify users and roles from inside MongoDB in an IONOS MongoDB cluster. You need to use the IONOS API for them.
This guide shows you how to connect to a MongoDB cluster from your managed Kubernetes cluster.
Before connecting to a MongoDB cluster from your managed Kubernetes, make sure you have:
A data center with id xyz-my-datacenter
.
A private LAN with id 3
.
A MongoDB cluster connected to LAN 3, with the connection string mongodb+srv://m-xyz-example.mongodb.de-txl.ionos.com
.
A Kubernetes cluster with id xyz-my-k8s-cluster
.
ionosctl
set up with your IONOS credentials.
Note: In this guide, we use DHCP to assign IP addresses to node pools. Therefore, it is important that the database is in the same subnet that is used by the DHCP server.
1.To enable connectivity, connect the node pools to the private LAN with the MongoDB cluster.
2. Wait for the node pool to become available. To test the connectivity you can create a pod that contains the MongoDB tool mongosh
. If you have multiple node pools, make sure to schedule the pod on one of the node of the node pools that are attached to the private LAN.
3. Create the pod by using the following command:
4. Attach the pod to the cluster by using the following command:
Result: You see the database is accepting connections.
If you see connection issues, make sure that the node is properly connected to the LAN. To debug the node, use a debugging container.
You can restore a database cluster in-place from a previous snapshot.
To restore from a snapshot you will need to provide a snapshot ID. You can request a list of all available snapshots:
Our chosen clusterId
is: cc54e0f2-5e49-42bf-97e8-089c2eff0264
You can now create a restore job for the chosen cluster. Your database will not be available during the restore operation. In order to successfully create a restore job, no other active restore job must exist.
Note: To restore a cluster in-place you can only use snapshots from that cluster.
Note: The cluster will have a BUSY
state and must not receive connections.
Restore snapshot request
Response
The API will respond with a 202 Accepted
status code if the request is successful.
Use the recovery target point in time which specifies the exact oplog timestamp that you choose to restore the database cluster.
Point in time recovery request
Response
The API will respond with a 202 Accepted
status code if the request is successful.
Note: Check the cluster details in order to see the progress of the restoration.
Quick Links: |