Maria DB Galera Cluster pros and crons

  • Use good index types when it’s necessary. Too many indexes will slow down your databases.
  • Set the best column data type. For example, do not use a char column data type if it stores only integers.
  • Avoid duplicated keys.
  • Optimize your SQL queries as much as possible.

MariaDB Galera Cluster

In Galera, databases shall comply with some requirements. The key ones user should follow creating tables are:

Architecture

  • True multi-master topology
  • Automatic new node provisioning
  • No data loss when nodes crash
  • Data replicas remain consistent
  • Automatic membership control
  • No complex and time-consuming failovers
  • Parallel transaction execution on all cluster nodes
  • No slave lag
  • No lost transactions
  • Reads/writes scalability
  • Smaller client latencies
  • Support of multi-cloud and multi-region deployments

what really happen when maria db server starts:

  • Each Server attempts to establish network connectivity with the other Servers in the cluster
  • Groups of connected Servers form a component
  • When a Server establishes network connectivity with the Primary Component, it synchronizes its local database with that of the cluster
  • As a member of the Primary Component, the Server becomes operational — able to accept read and write queries from clients
  • During startup, the Primary Component is the Server bootstrapped to run as the Primary Component. Once the cluster is online, the Primary Component is any combination of Servers which includes a minimum of more than half the total number of Servers.
  • A Server or group of Servers that loses network connectivity with the majority of the cluster becomes non-operational.
  • Each Server requires the minimum amount of disk space needed to store the entire database. The upper storage limit for MariaDB Enterprise Cluster is that of the smallest disk in use.
  • Each switch in use should have an odd number of Servers above three.
  • In a cluster that spans multiple switches, each data center in use should have an odd number of switches above three.
  • In a cluster that spans multiple data centers, use an odd number of data centers above three.
  • Each data center in use should have at least one Server dedicated to backup operations. This can be another cluster node or a separate Replica Server kept in sync using MariaDB Replication.

Cluster Configuration

[mariadb]

# General Configuration
bind_address = 0.0.0.0
innodb_autoinc_lock_mode = 2

# Cluster Configuration
wsrep_cluster_name = "accounting_cluster"
wsrep_cluster_address = "gcomm://192.0.2.1,192.0.2.2,192.0.2.3"

# wsrep Provider
wsrep_provider = /usr/lib/galera/libgalera_smm.so
wsrep_provider_options = "evs.suspect_timeout=PT10S"

General Configuration

Cluster Name and Address

Galera Replicator Plugin

Cluster Replication

Backups

Encryption

Failover

  1. availability
  2. recovery mechanism and most of all the benefits which mentioned above

--

--

--

Software Engineer | Data Engineer | AI Enthusiast

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Why I chose UI Toolkit over IMGUI to make my first Unity tool with

Image Processing Using “PYTHON”

209 Lorry loads of data

ST, Soviet battleship tier III — VII

YARA Cheat-sheet

MINIMA. How it works?

Daan: How we made our website blazingly fast

How to setup iofogctl on Raspberry Pi OS

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Gayan Sanjeewa

Gayan Sanjeewa

Software Engineer | Data Engineer | AI Enthusiast

More from Medium

How to monitor Redis with Prometheus and Grafana | Docker

Kubernetes Architecture — Processes run on Master Node

LEARN TO DEPLOY POSTGRES HA ON KUBERNETES IN 60 MINUTES

Getting started with Kubernetes