Scaleway DocumentationStorageManaged DatabaseHow to
Connect a Database to a Private Network

Jump toUpdate content

How to connect a Database Instance to a Private Network

Reviewed on 15 November 2021Published on 15 November 2019

Private Networks allows you to configure your own Layer-2 network with IPv4 addresses. That way, you can enhance the security of your system’s architecture by isolating it from the Internet.

This feature comes with a significant change in the architecture of Scaleway’s Managed 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 application and your database nodes. It also increases the security of your databases, as Instances in your Private Network can directly communicate with 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.

Requirements:

How to attach a Database Instance to a Private Network

  1. Click Database in the Storage section of the Scaleway Console side menu. A list of your Database Instances displays.
  2. Click the database name or «See more Icon» > More info to access the Database information page.
  3. Click the Private Networks tabs. The Private Network configuration displays.
  4. Click + Attach a Private Network. The Private Network configuration wizard displays.
  • Choose whether to:

    • Attach an existing Private Network and select the network from the drop-down list.
    • Attach a new Private Network and enter the name of the network in the form.
  • Enter the static IP for the Database Instance. The static IP can be any valid IP from a private address space, as specified in RFC 1918.

    Note:

    You can assign a static IP address from your IP range to your Database Instance. Your static IP must be at least the second IP in the range.

    Tip:

    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.

  1. Click Attach a Private Network to attach the IP address to your Instance. Your static IP is now assigned to the Database Instance:
Tip:

Private Networks are also available on Instances. Refer to the page on how to use Private Networks to attach an Instance to a Private Network and configure a persistent IP address on it.

How to detach a Database Instance from a Private Network

  1. Click Database in the Storage section of the Scaleway Console side menu. A list of your Database Instances displays.
  2. Click the database name or «See more Icon» > More info to access the Database information page.
  3. Click the Private Networks tabs. The Private Network configuration displays.
  4. Click «Unlink Icon» next to the static IP that you want to unlink from your Database Instance.
  5. Click Detach this Instance to remove the Instance from your Private Network.
See Also