Custom Parameters
a9s MariaDB Custom Parameters
As mentioned in Using an a9s Data Service - Custom Parameters as an end user, an Application Developer has the opportunity to customize their Service Instance by using custom parameters.
The following tables shows what customers parameters are available for a9s MariaDB.
Name | Description | Type | Default |
---|---|---|---|
binlog_expire_days | The number of days that the binary log should be kept on the instance that is running MariaDB before purging | A Positive Integer | 7 |
databases | List of the names of the databases that should exist in the instance other than the default database. Read more here. | An array of strings | null |
binlog_expire_days
is available starting from a9s MariaDB 10.4databases
is available starting from a9s MariaDB 10.6
databases Parameter
This custom parameter allows the Application Developer to create custom databases in their MariaDB instance. However, it's important to mention that there is always a default database that has the same name as the deployment name and it will exist regardless of that parameter value.
For example:
cf create-service a9s-mariadb mariadb-single-small my-mariadb-service
cf update-service my-mariadb-service -c '{"databases" : ["db1", "db2"]}'
In the example above, we first created a mariadb instance, and in the next step we updated the Service Instance to add
two more databases that are called db1
and db2
, so the user databases that will exist in the instance at this point
in time are [default-database
, db1
, db2
].
The databases
parameter is a declarative parameter, this means that every time this parameter is specified, all the
databases that the user wants to keep in the instance should be mentioned in the list and not just the new ones, the
only exception for this rule is the default database.
For example:
cf update-service my-mariadb-service -c '{"databases" : ["db1", "db2"]}'
after this update is done, the instance will have the following databases default-database
, db1
, db2
However, if we update the databases
parameter again:
cf update-service my-mariadb-service -c '{"databases" : ["db1", "db3"]}'
then, the custom database db2
will be dropped because it's not in the list and db3
will be created.
To delete all the custom databases, simply pass an empty list [] to the databases
parameter.
cf update-service my-mariadb-service -c '{"databases" : []}'
All the users that are created either by a service-key or by binding to an app, will have all the necessary privileges on all the user-databases, including the existing users.
databases
ParameterWhen updating the value of the databases
parameter, please make sure to list all the custom databases that must be
kept and not just the ones that should be added, any database that is not specified with the parameter value will be
dropped from the instance, the only exception is the default database.
We consider the backup as the source of truth, that means when restoring a backup, any database that does not exist in the backup file will be dropped.