Jump toUpdate content

Managed Database for PostgreSQL and MySQL
What is Scaleway Managed Database for PostgreSQL and MySQL?
Scaleway Managed Database for PostgreSQL and MySQL provides fully-managed relational Database Instances, supporting the database engines PostgreSQL and MySQL.
The product lets you focus on development, rather than administration or configuration. It comes with high-availability mode, data replication, and automatic backups.
In comparison to traditional database management, which requires customers to provision their infrastructure and resources to manage their databases, Scaleway Database offers the user access to a database instance without the need for setting up the hardware or configuring the software. Scaleway handles the provisioning, manages the configuration, and provides useful features as high availability, Automated Backup, User management, and more.
How can I access my database once it is provisioned?
On the details page of your Database Instance, the IP address and your Instance’s port are shown:
It is possible to connect to your Database Instance from any application using the IP address and port shown in the Endpoint section and the login/password of any valid database user. This can be managed from the “users” tab.
How can I manage my databases?
You can create a MySQL database,manage your MySQL database with PHPmyAdmin or delete your MySQL database. You can also create, manage or delete PostgreSQL databases.
See our documentation on upgrading a Database for PostgreSQL.
PostgreSQL
To access your PostgreSQL Database Instance, use the psql command-line tool with the following command:
psql -h $IP -p $PORT -U $YOUR_USER -d $DATABASE_NAME
You will have to enter your password to establish the connection. The default $DATABASE_NAME
to be used is rdb
.
MySQL
You can access your MySQL Database Instance with the following command:
mysql -h $IP --port $PORT -p -u $USERNAME
You will be prompted to enter your password to log in.
How do I import data into a Scaleway Database?
PostgreSQL
To import data into your Managed Database for PostgreSQL, export your data using the pg_dump
command in a first step:
pg_dump -h OLD_DB_IP -p OLD_DB_PORT -U OLD_DB_USERNAME -F c -b -v -f "/usr/local/backup/database.backup" DATABASE_NAME
Once the data is exported, import the database using the pg_restore command:
pg_restore -h INSTANCE_IP -p INSTANCE_PORT -U USERNAME -d DATABASE_NAME -v "/usr/local/backup/database.backup"
The different parameters used in the commands represent the following values:
-h
(—host): IP address of the host
-p
(—port): Port number of the host
-U
(—username): PostgreSQL user
-F
(—format): Format
c:
c just after a -F means that the format is the binary format specific to postgreSQL
-b
(—blobs): Specifies the binary string type
-v
(—verbose)
-f
(—file): Specifies the file name
MySQL
If you want to import your existing database into a Managed Database for MySQL, start by exporting your data using the command mysqldump
:
mysqldump -u username -p old_database > backup.sql
Then import the backup into your Scaleway Databases for MySQL
:
mysql -u username -p new_database < backup.sql
Which postgreSQL extensions are available?
The following pg_extensions
are available for Scaleway Database:
Extension name | Comment |
---|---|
chkpass | data type for auto-encrypted passwords |
pgrowlocks | show row-level locking information |
sslinfo | information about SSL certificates |
citext | data type for case-insensitive character strings |
tablefunc | functions that manipulate whole tables, including crosstab |
uuid-ossp | generate universally unique identifiers (UUIDs) |
pg_buffercache | examine the shared buffer cache |
intarray | functions, operators, and index support for 1-D arrays of integers |
bloom | bloom access method – signature file based index |
hstore | data type for storing sets of (key, value) pairs |
isn | data types for international product numbering standards |
dict_int | text search dictionary template for integers |
tsm_system_rows | TABLESAMPLE method which accepts number of rows as a limit |
btree_gin | support for indexing common datatypes in GIN |
plpgsql | PL/pgSQL procedural language |
tsm_system_time | TABLESAMPLE method which accepts time in milliseconds as a limit |
unaccent | text search dictionary that removes accents |
pgcrypto | cryptographic functions |
intagg | integer aggregator and enumerator (obsolete) |
pg_freespacemap | examine the free space map (FSM) |
pgstattuple | show tuple-level statistics |
pg_trgm | text similarity measurement and index searching based on trigrams |
cube | data type for multidimensional cubes |
dblink | connect to other PostgreSQL databases from within a database |
fuzzystrmatch | determine similarities and distance between strings |
earthdistance | calculate great-circle distances on the surface of the Earth |
dict_xsyn | text search dictionary template for extended synonym processing |
btree_gist | support for indexing common datatypes in GiST |
pg_visibility | examine the visibility map (VM) and page-level visibility info |
ltree | data type for hierarchical tree-like structures |
pg_prewarm | prewarm relation data |
postgis | PostGIS geometry, geography, and raster spatial types and functions |
address_standardizer_data_us | Address Standardizer US dataset example |
address_standardizer | Used to parse an address into constituent elements. Generally used to support geocoding address normalization step. |
postgis_sfcgal | PostGIS SFCGAL functions |
postgis_topology | PostGIS topology spatial types and functions |
postgis_tiger_geocoder | PostGIS tiger geocoder and reverse geocoder |
postgres_fdw | The postgres_fdw module provides the foreign-data wrapper postgres_fdw, which can be used to access data stored in external PostgreSQL servers. |
postgis_raster | PostGIS Raster implements the RASTER type like the GEOMETRY type support in PostGIS |
pgrouting | pgRouting extends the PostGIS / PostgreSQL geospatial database to provide geospatial routing functionality |
ogr_fdw | OGR is the vector half of the GDAL spatial data access library |
timescaledb | enable handling of time-series data |
tsearch2 | backwards-compatible text search for applications that used tsearch2 before text searching was integrated into core PostgreSQL 8.3 |
pg_cron | cron-based job scheduler for PostgreSQL |
pg_stat_statements | track planning and execution statistics of all SQL statements executed by a server |
How do I backup my database?
If the automatic backup feature is enabled, new backups will be created according to your backup schedule, which can be set on the “Instance overview” tab. Your Instance is available during backup, but there might be a performance impact and some actions may not be available. Automatic backups are enabled by default. It is possible to disable them at any time in the backup settings of your Instance. It is also possible to launch manual backups by clicking on the Create a backup button from the backups tab.
Are my active and standby database nodes in a high-availability cluster hosted in the same datacenter?
In a high-availability cluster, active and hot standby nodes are indeed located in the same datacenter but in two separated racks.
The idea is to offer the best performance to ours users by reducing latency between active and hot standby nodes, as we use a sync replication process between the nodes.
What is the Private Networks feature for Database Instances?
Private Networks allows you to configure your own Layer-2 network with IPv4 adresses. You can therefore enhance the security of your system architecture by isolating it from the Internet.
This feature introduces a significant change in the architecture of Scaleway’s Databases: when using Private Networks, your application connects directly to your Database nodes, without going through a Load Balancer. This improves performance by reducing the latency between your nodes. It also increases the security of your databases, since Instances in your Private Network can directly to your Database Instance, without passing through the public Internet.
You can create new Database Instances to attach to your Private Network, or attach existing Database Instances by adding Private Networks endpoints to them.
How many Private Networks can I attach?
Currently, you can connect one Private Network to each Database Instance.
Can I use any IP Range for my Private Network?
For now, only the RFC1918 IP subnets are accepted as Database Instances virtual IPv4.
How is the Database’s private failover IP managed?
The virtual IPv4 used to expose the Database Instance service is automatically routed to the new promoted node and announced within 10s to the neighboring Compute Instances.
Can I remove the Load Balancer endpoint from my Database Instance?
You can not remove the Load Balancer endpoint from your Database Instance, but you can block all access by emptying the allowed IPs list from the console or via the API.
Can I limit the IPs allowed to reach my Database Instance on a Private Network?
It is not possible to limit access to a Database Instance on a Private Network. We recommend that you create a dedicated Private Network for your Database Instances and add only the relevant middleware application Instances to this Private Network.
Can I add an IPv6 to my Database Instance?
IPv6 is not supported with Private Networks on Database Instances.
In what regions is the Private Networks feature available for Managed Database for PostgreSQL and MySQL?
Private Networks is available for PostgreSQL and MySQL Database Instances in PAR1, AMS1 and WAW1.
Currently, you cannot connect PAR2 or PAR3 Instances to a Database Instance located in the Paris region using Private Networks.
RDB Region | Private Network Region |
---|---|
Amsterdam (nl-ams ) | nl-ams-1 «Validate Icon» nl-ams-2 «Cancel Icon» |
Paris (fr-par ) | fr-par-1 «Validate Icon» fr-par-2 «Cancel Icon» fr-par-3 «Cancel Icon» |
Warsaw (pl-waw ) | pl-waw-1 «Validate Icon» |
Can I assign a Database virtual IP with DHCP?
No, you need to provide a static IPv4 with CIDR notation on the same subnet as the one configured on your Private Network.
You can use the Database virtual IP (VIP) in a DHCP-controlled environnement by reserving the IP in the DHCP server configuration to be sure it is not assigned to any other Instance, then configure it on the Private Networks endpoint.
How to update my Service IP once the endpoint created?
You need to delete and recreate the endpoint with the new Service IP
What should I use as virtual IP? How do I calculate the CIDR netmask?
CIDR notation is the shortest notation containing required information to configure the endpoint: IP address and network mask. The network mask part is required for IP routing purposes. You may use a network calculator if required.
Examples:
Network Address | Netmask (Dotted Quad) | Netmask (CIDR) | First usable host IP address | Last usable host IP address | Example VIP |
---|---|---|---|---|---|
192.168.0.0/24 | 255.255.255.0 | 24 | 192.168.0.1 | 192.168.0.254 | 192.168.0.33/24 |
10.18.0.0/16 | 255.255.0.0 | 16 | 10.18.0.1 | 10.18.255.254 | 10.18.21.42/16 |
192.168.18.0/26 | 255.255.255.192 | 26 | 192.168.18.1 | 192.168.18.63 | 192.168.18.37/26 |
Can I use the second node on High Available Managed Database Instance ?
No, the second node created when you activate the HA on your Managed Database Instance is a hot standby. This node allows a fast failover in case of issues on the primary node.
Please use the read replica feature.