<p>I am planning to deploy HA database cluster on my kubernetes cluster. I am new to database and I am confused by the various database terms. I have decided on MariaDB and I have found two charts, <a href="https://artifacthub.io/packages/helm/bitnami/mariadb" rel="nofollow noreferrer">MariaDB</a> and <a href="https://artifacthub.io/packages/helm/bitnami/mariadb-galera" rel="nofollow noreferrer">MariaDB Galera Cluster</a>.</p>
<p>I understand that both can achieve the same goal, but what are the main differences between the two? Under what scenario I should use either or?</p>
<p>Thanks in advance!</p>

WeiTang Lau
<p>I'm not an expert so take my explanation with precaution (and double check it)</p>
<p>The main difference between the MariaDB's Chart and the MariaDB Galera Cluster's Chart is that the first one will deploy the standard master-slave (or primary-secondary) database, while the second one is a resilient master-master (or primary-primary) database cluster.</p>
<p>What does it means in more detail is the following:</p>
<p><strong>MariaDB Chart</strong> will deploy a Master <strong>StatefulSet</strong> and a Slave <strong>StatefulSet</strong> which will spawn (with default values) one master Pod and 2 slave Pods. Once your database is up and running, you can connect to the master and write or read data, which is then replicated on the slaves, so that you have safe copies of your data available.</p>
<p>The copies can be used to read data, but only the master Pod can write new data in the database. Should the Pod crash.. or the Kubernetes cluster node where the Pod is running malfunction, you will not be able to write new data until the master's Pod is once more up and running (which may require manual intervention).. or if you perform a failover, promoting one of the other Pods to be the new temporary master (which also requires a manual intervention or some setup with proxies or virtual ips and so on).</p>
<p><strong>Galera Cluster Chart</strong> instead, will deploy something more resilient. With default values, it will create a single <strong>StatefulSet</strong> with 3 Pods.. and each one of these Pods will be able to either read and write data, acting virtually as a master.</p>
<p>This means that if one of the Pods stop working for whatever reason, the other 2 will continue serving the database as if nothing happened, making the whole thing way more resilient. When the Pod (which stopped working) will come back up and running, it will obtain the new / different data from the other Pods, getting in sync.</p>
<p>In exchange for the resilience of the whole infrastructure (it would be too easy if the Galera Cluster solution would offer extreme resilience with no drawbacks), there are some cons in a multi-master application, with the more commons being some added latency in the operations, required to keep everything in sync and consistent.. and added complexity, which often may brings headaches.</p>
<p>There are several other limits with Galera Cluster, like explicit LOCKS of tables not working or that all tables must declare a primary key. You can find the full list here (<a href="https://mariadb.com/kb/en/mariadb-galera-cluster-known-limitations/" rel="nofollow noreferrer">https://mariadb.com/kb/en/mariadb-galera-cluster-known-limitations/</a>)</p>
<p>Deciding between the two solutions mostly depends on the following question:</p>
<ul>
<li>Do you have the necessity that, should one of your Kubernetes cluster node fail, the database keeps working (and being usable by your apps) like nothing happened, even if one of its Pods was running on that particular node?</li>
</ul>
