This interface layer handles the communication between MySQL Router and a MySQL
InnoDB Cluster and facilitates proxying database requests from database
clients.
* requires handles communication with MySQL InnoDB Cluster
* provides handles communication with database clients
Usage
Requires
On the requires side, the interface handles requesting a user for MySQL Router
and also handles proxying database requests to the MySQL InnoDB cluster from
its provides side.
All requests over the mysql-router interface are prefixed using the following
pattern:
The interface will automatically determine the network space binding on the
local unit to present to the remote mysql-router server based on the name of
the relation. This can be overridden using the hostname parameter in the
configure_db_router and configure_proxy_db methods.
Provides
The interface layer will set the following states, as appropriate:
{relation_name}.connected The relation is established, but the client
has not provided the database information yet.
{relation_name}.available The requested information is complete. The DB,
user and hostname can be created.
Connection information is passed back to the client with the following method:
The interface will automatically determine the network space binding on the
local unit to present to the remote mysql-shared client based on the name of
the relation. This can be overridden using the db_host parameter of the
set_db_connection_info method.
Overview
MySQL Router Interface
This interface layer handles the communication between MySQL Router and a MySQL InnoDB Cluster and facilitates proxying database requests from database clients.
Usage
Requires
On the requires side, the interface handles requesting a user for MySQL Router and also handles proxying database requests to the MySQL InnoDB cluster from its provides side.
All requests over the mysql-router interface are prefixed using the following pattern:
Examples:
The mysql-router user request using the prefix, “mysqlrouter”:
A proxied DB request using the prefix, “novaapi”:
The interface layer will set the following states, as appropriate:
{relation_name}.connectedThe relation is established, but no data has yet been exchanged.{relation_name}.availableMySQL Router has a user in the MySQL InnoDB Cluster.{relation_name}.available.proxyProxied database requests are complete.Received connection information is available via the following methods:
allowed_units(prefix)database(prefix)db_host(prefix)hostname(prefix)username(prefix)password(prefix)Requests can be made of the MySQL InnoDB Cluster with the following methods:
For MySQL Router itself:
For a proxied database request:
For example:
The interface will automatically determine the network space binding on the local unit to present to the remote mysql-router server based on the name of the relation. This can be overridden using the hostname parameter in the configure_db_router and configure_proxy_db methods.
Provides
The interface layer will set the following states, as appropriate:
{relation_name}.connectedThe relation is established, but the client has not provided the database information yet.{relation_name}.availableThe requested information is complete. The DB, user and hostname can be created.set_db_connection_info()For example:
The interface will automatically determine the network space binding on the local unit to present to the remote mysql-shared client based on the name of the relation. This can be overridden using the db_host parameter of the set_db_connection_info method.