Wars of MySQL Clusters
(Galera Vs Group Replication)
Karthik P R
CEO, Mydbops
January 30, 2021
Mydbops Database Meetup -8
Interested in Open Source Database technologies
11 Years of Experience with MySQL
Ex-Yahoo!
Tech Speaker/ Blogger 
CEO Mydbops
Karthik P R 
About Me
Database
Consulting
Services
Managed
Database
Services
Focuses on Top Opensource database MySQL,MariaDB,
MongoDB and PostgreSQL ON Premises and Cloud
Mydbops Services
Replication in MySQL
Synchronous Replication Solutions
History of Synchronous Replication
Galera Vs Group Replication
Features comparison
Agenda
Replication in MySQL
Replication in MySQL
Replication
Synchronous
Replication
Asynchronous
Replication
Semi Synchronous
Replication
Replication in MySQL
Replication ( redundancy ) is a common solution for High Availability
Asynchronous Replication
Native replication ( data lag )
Logical Replication ( Binlog based )
Various architecture is Possible
Filtering in Replication
Engine Independent
Replication in MySQL
Synchronous Replication
Zero replication lag
2 Phase commit
Based on Replication Database State Machine Theory
Automated Primary Promotion
Replication is Synchronous
Applying is Asynchronous
Synchronous Replication
Solutions
Synchronous Replication Solutions
Synchronous
Replication Solutions
Galera Group Replication
Synchronous Replication Solutions in MySQL
Synchronous Replication
Galera ( Codership )
Plugin with MySQL
Percona XtraDB Cluster
MariaDB Cluster
Group Replication ( MySQL Native )
History of Synchronous
Replication
Codership Pioneered the Synchronous replication for MySQL.
Codership released the first version of Galera in May 2007
Percona XtraDB Cluster First release Apr 2012
MariaDB Cluster First release Feb 2014
MySQL Group Replication Dec 2016 ( 5.7.17 )
History of Synchronous Replication
Galera Vs Group Replication
Supports only InnoDB Engine
Parallel Replication
Multi-master writes
Paxos based
Optimistic locking
Network-based Cluster
Galera & Group Replication
Feature Comparison
GCS Protocol
Flow Control
Node Provisioning
Large Transaction Support
Consistency Levels
Galera & Group Replication
Feature Comparison
WriteSet Support
WriteSet / Message Cache
Arbitrator Support
Native GTID Support
Load Balancer Support
Galera & Group Replication
GSC Protocol
Galera Based Solution
Totem Single Ring ordering
Group Replication
Paxos based. eXtended COMmunication ( XCOM )
GCS Protocol
Flow Control
gcs.fc_limit ,gcs.fc_master_slave, gcs.fc_factor
group_replication_flow_control_mode
Galera Based Solution
Flow Control stops the writes when triggered.
Group Replication
Each node can throttle writes when triggered
Collect stats from every node
Flow Control
Node Provisioning
Galera Based Solution
IST ( Incremental snapshot transfer )
Incremental state transfer using gcache
SST ( state snapshot transfer )
mysqldump
rsync
xtrabackup-v2 ( Hot method )
Mariabackup ( Hot method in MariaDB Cluster )
Node Provisioning
group_replication_clone_threshold auto-provision based on transaction gap.
Group Replication Based Solution
Message cache ( Incremental data )
Async Replication
Clone Plugin - 8.0.17 ( 22-07-2019 )
Node Provisioning
Additional Information
https://galeracluster.com/2021/01/galera-cluster-for-mysql-5-6-50-5-7-32-and-8-0-22-released/
Clone Plugin is supported Galera SST from 8.0.22 ( 14 Jan 2021 )
Not available in PXC or MariaDB Cluster yet
Node Provisioning
Large Transaction Support
Galera Based Solution
Streaming Replication
Galera 4 ( PXC 8.0 and MariaDB 10.4 & above )
wsrep_trx_fragment_size
wsrep_trx_fragment_units
Large Transaction Support
The default is 10MB messages above it are fragmented ( chunked ) and
broadcasted.
Group Replication
Huge transaction are supported from 8.0.16 ( 2019-04-25)
group_replication_communication_max_message_size
Large Transaction Support
Consistency Level
Galera/PXC
The causality check is enabled by "wsrep_sync_wait"
It has multiple levels (0,1,2,3,4,8 )
Consistency Levels
Group Replication
The consistency check is controlled by "group_replication_consistency"
It is available from 8.0.14 ( 2019-01-21 )
Modes
EVENTUAL
BEFORE
AFTER
BEFORE AND AFTER
BEFORE_ON_PRIMARY_FAILOVER
Consistency Levels
WriteSet Support
Galera Based Solution
Galera uses writeset from the initial release with its own GTID
The Parallel replication is enhanced with writeset.
Group Replication
Writeset is introduced on MySQL 8.0
Binlog based transaction extraction applier
Writeset & Writest session ( logical_clock replication )
Writeset Support
WriteSet Cache Support
Galera Based Solution
Galera uses writeset cache or Gcache for IST and local recovery.
wsrep_provider_option="gcache.size=128M"
Group Replication
It uses message cache size ( From 8.0.16 ) ( 2019-04-25)
Group_replication_message_cache-size ( 128 MB ) 8.0.21
Writeset Cache Support
Arbitrator Support
* Not a big deal if storage is not a big deal.
Galera Based Solution
Galera Provides Arbitrartor Support
Group Replication
Group Replication does not provide Arbitrator Support
Arbitrator Support
Native GTID Support
Galera Based Solution
Generates its own GTID in 5.5, 5.6, 5.7 versions
Galera started to support native MySQL GTID from MySQL 8.0.
Group Replication
Group Replication is built on top of GTID
Native GTID Support
Load Balancer Support
Galera Based Solution
Galera has support for Maxscale and ProxySQL ( inbuilt )
Percona XtraDB Cluster has inbuilt support for ProxySQL
ProxySQL check can be made better with external scripts
Group Replication
Group Replication has support for MySQL Router and ProxySQL
PrxoySQL is most recommended.
Load Balancer Support
Reach Us : Info@mydbops.com
Thank You

Wars of MySQL Cluster ( InnoDB Cluster VS Galera )