Skip to main content

Databases

NNumbers Cloud's database-as-a-service product is made up of database instances, database types (datastores), and databases.

Depending on the database type, a database instance can hold one or more databases. A database instance can also belong to a custom configuration group.

Creating a database instance​

Open the NNumbers Cloud console

In the left menu, click Databases and then Instances:

NNumbers Cloud console, Databases: in the left menu, click Databases and then Instances

The next screen lists the database instances created previously. You can also perform administrative actions (item 2) or create new databases (item 1).

NNumbers Cloud console, Databases: the next screen lists the database instances created

Clicking Launch Instance (item 1) opens the window below, where you fill in the following:

NNumbers Cloud console, Databases: clicking Launch Instance opens the following window NNumbers Cloud console, Databases: clicking Launch Instance opens the following window

  • Availability zone: preselected (currently a single availability zone); states which availability zone the compute instance running the selected managed datastore will run in.

  • Instance name: the name given to the managed compute instance.

  • Volume size: the volume size in gigabytes that will hold the database(s) and the selected datastore's binaries.

  • Volume type: currently only RBD is available.

  • Datastore: the datastore type and version.

  • Flavor: the profile of CPU and memory for the instance running the database management service.

  • Locality: states whether future replica instances are created on the same physical host (affinity) or on different physical hosts (anti-affinity). This value is ignored if the instance being launched is a replica

NNumbers Cloud console, Databases: Locality: states whether future replica instances are

NNumbers Cloud console, Databases: Locality: states whether future replica instances are

  • To select a network, click "➕" on the network(s) listed under Available networks.

  • To drop a selected network, click "➖".

  • You can select more than one network, if you have several private networks and the database(s) need to be visible on both.

NNumbers Cloud console, Databases: you can select more than one network, if you have several

NNumbers Cloud console, Databases: you can select more than one network, if you have several

  • Is Public: when checked, enables a floating IP on the database instance.

  • Allowed CIDRs: lets you list the CIDRs allowed to reach the database. If left empty, 0.0.0.0/0 is used.

NNumbers Cloud console, Databases: Allowed CIDRs: lets you list the CIDRs allowed to

NNumbers Cloud console, Databases: Allowed CIDRs: lets you list the CIDRs allowed to

  • Initial databases (optional): give a comma-separated list of databases to create

  • Initial admin user (required): give the name of the user to be created with administrative permissions.

  • Password (required): give the password for the user to be created with administrative permissions.

  • Allowed host (optional): lets the user connect only from this host. If left empty, the user is allowed to connect from anywhere.

NNumbers Cloud console, Databases: Allowed host (optional): lets the user connect only

NNumbers Cloud console, Databases: Allowed host (optional): lets the user connect only

  • Configuration group (optional): lets you select a configuration group created earlier (see Managing configuration groups).

  • Source for initial state (optional): lets you choose between creating an instance from a backup and creating a replica from a new instance.

  • Replica count: when replica was selected above, sets how many replicas to launch

NNumbers Cloud console, Databases: Replica count: when replica was selected above

When Restore from Backup is selected under Source for initial state, the Backup name field is enabled so you can pick the backup whose data the instance will use to create and populate its initial state.

NNumbers Cloud console, Databases: when Restore from Backup is selected under Source

When Replicate Instance is selected under Source for initial state, the Master instance name field is enabled so you can pick the master instance.

Once the form is filled in, click Launch.

Managing the databases inside an instance​

Open the NNumbers Cloud console

In the left menu, click Databases -> Instances:

NNumbers Cloud console, Databases: in the left menu, click Databases -> Instances

On the page listing the database instances you created, find the one you want and click its name.

NNumbers Cloud console, Databases: on the page listing the database instances you created

Inside the instance, click Databases in the top menu (item 1). Every database created while creating the database instance is listed. On this screen you can create a new database inside the instance (item 2) or remove a database (item 3) from it. If you remove one, remember to take a backup first.

NNumbers Cloud console, Databases: inside the instance, in the top menu click Databases

Creating databases​

Following the Managing the databases walkthrough, click + Create Database (item 2).

In the form, fill in the name field (item 1) and click Create Database (item 2).

NNumbers Cloud console, Databases: in the form, fill in the name field and then click

Managing configuration groups​

A configuration group is used to change the database's global variables. For example, changing max_connections to set the maximum number of connections allowed for MySQL or MariaDB databases.

Open the NNumbers Cloud console

In the left menu, click Databases -> Configuration Groups:

NNumbers Cloud console, Databases: in the left menu, click Databases -> Configuration Groups

A screen like the one below appears, where you can create a new configuration (item 1) or delete existing ones (item 2). To edit a configuration, click its name (item 3).

NNumbers Cloud console, Databases: a screen like the one below appears, where you can

Creating configuration groups​

Following the Managing configuration groups walkthrough, click + Create Configuration Group.

In the window that opens, give the group a name (Name field) and, under Datastore, select the database type and version. This walkthrough uses MySQL. Click Create Configuration Group.

NNumbers Cloud console, Databases: in the window that opens, give the group a name (Name field)

Editing configuration groups​

Following the Managing configuration groups walkthrough, find the group you want and click its name (as in item 3).

You get a screen like the one below. To add a parameter, click + Add Parameter.

NNumbers Cloud console, Databases: you get a screen like the one below

In the window that opens, find the parameter under Name and set the value under Value (item 1). Once filled in, click Add Parameter (item 2).

NNumbers Cloud console, Databases: in the window that opens, find the parameter under Name

The parameter then appears in the list, as shown below. The next step is to apply or discard the changes (item 1). To remove parameters, find one in the list and click Delete Parameter (item 2)

NNumbers Cloud console, Databases: the parameter then appears in the list

Managing users​

Open the NNumbers Cloud console

In the left menu, click Databases -> Instances:

NNumbers Cloud console, Databases: in the left menu, click Databases -> Instances

On the page listing the database instances you created, find the one you want and click its name:

NNumbers Cloud console, Databases: on the page listing the database instances you created

Inside the instance, click Users in the top menu (item 1). Every user created earlier — or during database instance creation — is listed. This screen offers several options: create a new user (item 2), delete (item 3), or manage a given user (item 4).

NNumbers Cloud console, Databases: inside the instance, in the top menu click Users

Creating a database user​

To create a user, keep following the Managing users walkthrough. On the user list, click + Create User.

In the window that opens, fill in:

  • Name (note: use only letters, numbers, -, and _).
  • Password (type a password for this user)
  • Host ("%" to allow access from anywhere, or a specific address. For example, a single host: 192.168.15.10, or a range: 192.168.15.1/255.255.255.240)
  • Initial Databases (the databases this user may reach — see the Creating databases walkthrough)

Once filled in, click Create User (item 2)

NNumbers Cloud console, Databases: once filled in, click Create User

Managing database instance logs​

Logs give you information about a database instance, such as:

  • The instance's general log: every action taken by users and applications on the database instance.
  • The slow query log: queries that take a long time to run and probably consume a lot of the instance's resources.

This walkthrough covers how to enable and read those logs.

Open the NNumbers Cloud console

In the left menu, click Databases -> Instances:

NNumbers Cloud console, Databases: in the left menu, click Databases -> Instances

On the page listing the database instances you created, find the one you want and click its name.

NNumbers Cloud console, Databases: on the page listing the database instances you created

Inside the instance, click Logs in the top menu (item 1). In the list, find the log type you want to enable, click 🔽 under actions (item 2), and click Enable Log. Once the logs are enabled, click Publish Log (item 2); the logs are published to the default Object Store (the object store name varies with the type of database instance created).

NNumbers Cloud console, Databases: inside the instance, in the top menu click Logs

Once the logs are enabled, you can read them through View log:

NNumbers Cloud console, Databases: once the logs are enabled, you can read them through View

A new window opens showing the log:

NNumbers Cloud console, Databases: a new window opens showing the log

Backing up a database​

Open the NNumbers Cloud console

In the left menu, click Databases -> Backups.

NNumbers Cloud console, Databases: in the left menu, click Databases -> Backups

The backups taken previously are listed. On this screen you can administer them (restore and delete).

NNumbers Cloud console, Databases: the backups taken previously are listed

There are two backup types: a full backup, which creates a complete backup of a database, and an incremental one, which creates a backup holding only the difference between a full backup and the database's current state.

info

Incremental backups are only available on MySQL and MariaDB database instances.

To create a backup, click Create Backup at the top of the page. A new window opens, as shown:

NNumbers Cloud console, Databases: to create a backup, at the top of the page click Create Backup

Under Name, type a name that helps you find the backup — for example, "DB_XZY-2022-10-02".

Under Database Instance, select the database to back up.

Parent Backup decides whether this is a full backup (select nothing) or an incremental one (select the most recent backup in the list for that database). Once filled in, click backup at the bottom of the form.

The backup then appears in the list alongside the others.

Restoring a database instance backup​

Open the NNumbers Cloud console

In the left menu, click Databases -> Backups.

NNumbers Cloud console, Databases: in the left menu, click Databases -> Backups

In the list of backups created earlier, find the one you want and click Restore backup.

NNumbers Cloud console, Databases: in the list of backups created earlier, find the backup

A new window opens where you fill in Instance Name, Volume Size (the disk size for the database), and Flavor (the plan of CPU and memory allocated to the database).

NNumbers Cloud console, Databases: a new window opens where you fill in some

Once the first part of the form is filled in, click Networking at the top and select which network(s) to use. In the network list (Available Networks), click ➕.

NNumbers Cloud console, Databases: once the first part of the form is filled in, click Networking

After selecting the network(s), click the Advanced tab at the top of the form. If you used a Configuration Group, select it from the list. Otherwise leave the default (Select configuration). Then click Launch at the bottom.

NNumbers Cloud console, Databases: after selecting the network(s), click the Advanced tab at the

After clicking Launch, the database list appears.

NNumbers Cloud console, Databases: after clicking Launch, the database list appears

Creating database replica instances​

Open the NNumbers Cloud console

In the left menu, click Databases -> Instances

NNumbers Cloud console, Databases: in the left menu, click Databases -> Instances

On the screen listing the database instances, click Launch Instance.

NNumbers Cloud console, Databases: on the screen listing the database instances, click

In the window that opens, fill in Instance Name, Volume Size (the disk size for the database), and Flavor (the plan of CPU and memory allocated to the database).

NNumbers Cloud console, Databases: in the window that opens, fill in some

Once the first part of the form is filled in, click Networking at the top and select which network(s) to use. In the network list (Available Networks), click ➕.

NNumbers Cloud console, Databases: once the first part of the form is filled in, click Networking

After selecting the network(s), click the Advanced tab at the top of the form. If you used a Configuration Group, select it from the list. Otherwise leave the default (Select configuration). Under Source for initial State, choose Replicas from Instance, then under Master Instance Name select the database instance whose data will be replicated to this new one. Under Replica Count, state how many replicas to create.

NNumbers Cloud console, Databases: after selecting the network(s), click the Advanced tab at the

Then click Launch at the bottom.

Next steps​