MySQL Clustering over InnoDB engines has grown a lot over the last decade. Galera began working with InnoDB early and then Group Replication came to the environment later, where the features are now rich and robust. This presentation offers a technical comparison of both of them.
7. 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
8. 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
11. Synchronous Replication Solutions in MySQL
Synchronous Replication
Galera ( Codership )
Plugin with MySQL
Percona XtraDB Cluster
MariaDB Cluster
Group Replication ( MySQL Native )
13. 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
23. 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
27. 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
28. 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
31. 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
33. 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
35. 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
37. * 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
39. 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
41. 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