Skip to content

Commit

Permalink
Merge pull request #135 from vshn/add/mariadb_scaling
Browse files Browse the repository at this point in the history
Add MariaDB scaling docs
  • Loading branch information
Kidswiss authored Nov 4, 2024
2 parents cc49f31 + 9c47723 commit 9ab8143
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
** xref:vshn-managed/mariadb/restore.adoc[Restore]
** xref:vshn-managed/mariadb/security.adoc[Security]
** xref:vshn-managed/mariadb/usermanagement.adoc[]
** xref:vshn-managed/mariadb/replicas.adoc[]
.Redis
* xref:exoscale-dbaas/redis/index.adoc[On Exoscale]
Expand Down
55 changes: 55 additions & 0 deletions docs/modules/ROOT/pages/vshn-managed/mariadb/replicas.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
= Replication and High Availability

MariaDB by VSHN comes with support for multiple instances and High Availability using https://mariadb.com/kb/en/galera-cluster/[Galera].
You have the option to configure up to two additional replicas.
Please be aware of its https://mariadb.com/kb/en/mariadb-galera-cluster-known-limitations/[limitations] before using it.

== Enable High Availability

To enable high availability you need to set the number of instances to `3`, which will provision two replicas.

The following example configuration will start a MariaDB service with three replicas.

NOTE: When HA is enabled, changing users via the VSHNMariaDB claim will result in a quick restart of ProxySQL. This will interrupt the connection for a few seconds. Also be aware that connections will only work via users that are specified in the claim.

[source,yaml]
----
apiVersion: vshn.appcat.vshn.io/v1
kind: VSHNMariaDB
metadata:
name: mariadb-app1-prod
spec:
parameters:
instances: 3
----

NOTE: Please be aware that enabling high availability will use significantly more resources and will cost three times more.

IMPORTANT: On APPUiO Cloud, it's currently not possible to deploy more than two instances, or more than a single instance that is larger than `standard-2`.
Please contact https://docs.appuio.cloud/user/contact.html[APPUiO Cloud support], if this blocks you from running your application.


== ProxySQL

In order to optimize the connections to the Galera Cluster, a separate two node ProxySQL cluster is deployed as well.
The ProxySQL cluster will manage reconnections in case of failovers.
ProxySQL will identify itself as a MySQL server version 8, which is the expected behavior.

This ProxySQL will also consume certain resources in addition to Galera itself.
Please consult the following table for more details.

[cols="1s,1,1", options="header", stripes="even"]

|===
|
|Requests
|Limits

|CPU
|50m
|500m

|Memory
|64Mi
|256Mi

0 comments on commit 9ab8143

Please sign in to comment.