SlideShare a Scribd company logo
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL Group Replication
An Overview
1
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole discretion of Oracle.
2
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
Program Agenda
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
Program Agenda
The Theory
How It Works
How to Use It
Conclusion
1
2
3
4
4
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
The Theory1
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
M S S
S
S
M
write clients read clients
read clients
write clients
More reads?
More slaves!
Read scale-out
Background: What is Replication Used For?
6
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
C
B
A
C
B
ACrash
C
B
A
B is the
new master
Uh Oh! Whew!
Redundancy: If master crashes, promote slave to master
Background: What is Replication Used For?
7
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL Group Replication
8
M M M M M
Replication Group
Clients
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL Group Replication
• What is MySQL Group Replication?
ā€œMulti-master update anywhere replication plugin for MySQL with built-in automatic
distributed recovery, conflict detection, and group membership.ā€
• What does the MySQL Group Replication plugin do for the user?
– Removes the need for manually handling server fail-over
– Provides distributed fault tolerance
– Enables Active/Active update anywhere setups
– Automates group reconfiguration (handling of crashes, failures, re-connects)
– Provides a highly available distributed database service
9
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
Use Cases
• Elastic Replication
– Environments that require a very fluid replication infrastructure, where the number
of servers has to grow or shrink dynamically and with as little manual intervention as
possible.
• Highly Available Shards
– Sharding is a popular approach to achieve write scale-out. Users can use MySQL
Group Replication to implement highly available shards. Each shard can map to an
individual Replication Group.
• Alternative to Master-Slave Replication
– It may be that a single master server makes it a single point of contention. Writing to
an entire group may prove more scalable under certain circumstances.
10
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
The Theory Behind It
• Implementation is based on ā€œReplicated Database State Machinesā€
– Group Communication primitives resemble general properties of Databases
– Distributed systems meet Databases: Pedone, Guerraoui, and Schiper paper
• Deferred update replication: before committing locally we certify it on all nodes
– In order to implement it one needs Atomic Broadcast – the change occurs everywhere or nowhere
– This is necessary to ensure data consistency across all nodes
• Membership Service
– Group Membership: it allows one to know that at a given moment in time all the members that are
participating in the protocol are associated with the same logical identifier (view id)
– View Synchrony: ensure that messages from past views are all delivered before a new view is installed
11
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
How It Works2
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
Example: Adding a Node to an Existing Group
• Create a user for automated distributed recovery:
• Server needs to be started with a valid configuration:
13
./bin/mysqld --no-defaults --basedir=. --datadir=<DATADIR_LOCATION> –P <PORT> 
--socket=mysqld<ID>.sock --log-bin=master-bin --server-id=<ID> 
--gtid-mode=on --enforce-gtid-consistency --log-slave-updates 
--binlog-checksum=NONE --binlog-format=row 
--master-info-repository=TABLE --relay-log-info-repository=TABLE 
--transaction-write-set-extraction=MURMUR32 
--plugin-dir=lib/plugin --plugin-load=group_replication.so
./bin/mysql -uroot -h 127.0.0.1 -P 13001 -p --prompt='server1>'
server1>
CREATE USER 'rpl_user'@'%' IDENTIFIED BY 'rpl_pass';
GRANT REPLICATION SLAVE ON *.* TO rpl_user@'%';
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
Example: Adding a Node to an Existing Group (2)
• Now lets configure the replication user used for recovery:
• Now the group communication backbone:
14
SET GLOBAL group_replication_recovery_user='rpl_user';
SET GLOBAL group_replication_recovery_password='rpl_pass';
SET GLOBAL group_replication_group_name= <valid UUID>;
SET GLOBAL group_replication_local_address=<this node address:port for the
communication backbone>;
SET GLOBAL group_replication_peer_addresses= <comma-separated list of all other
nodes in the group>;
SET GLOBAL group_replication_bootstrap_group= 0;
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
Example: Adding a Node to an Existing Group (3)
• Server that joins the group will automatically synchronize with the others
• It will retrieve the diff between its data and the rest of the group
• Hint: provision the new node with base data (i.e. restore a backup) before joining an existing group
15
M M M M M N
I want to join the group
START GROUP_REPLICATION;
ONLINE
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
Example: Adding a Node to an Existing Group (4)
16
M M M M M N
ONLINE RECOVERING
SELECT * FROM performance_schema.replication_group_membersG
M M M M M N
ONLINE
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
Example: Automated Group Membership
• If a server leaves the group, the others will automatically be informed
17
M M M M M M
My machine needs maintenance
or a system crash happens
Each membership configuration
is identified by a view_id
view_id: 4
STOP GROUP_REPLICATION;
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
Example: Automated Group Membership (2)
• If a server leaves the group, the others will automatically be informed
• Server that (re)joins the group will automatically synch with the others
18
M M M M M
view_id: 5
M M M M M M
RECOVERING -> ONLINE
view_id: 6
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
How to Use It3
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
Multi-Master Update Anywhere!
• Any two transactions on different servers can write to the same row
• Conflicts will automatically be detected and handled
– First committer wins rule
20
M M M M M
UPDATE t1 SET a=4 WHERE a=2UPDATE t1 SET a=3 WHERE a=1
OKOK
M M M M M
UPDATE t1 SET a=2 WHERE a=1UPDATE t1 SET a=3 WHERE a=1
OK
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
Full GTID Support
• All group members share the same UUID, which is the group name
21
M M M M M
INSERT y;
Will have GTID: group_name:2
INSERT x;
Will have GTID: group_name:1
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
Monitoring the Replication Group
• Monitor group health and stats using Performance Schema tables
22
mysql> SELECT * FROM
performance_schema.replication_connection_statusG
*************************** 1. row ***************************
CHANNEL_NAME: group_replication_applier
GROUP_NAME: 8a94f357-aab4-11df-86ab-c80aa9429563
SOURCE_UUID: 8a94f357-aab4-11df-86ab-c80aa9429563
THREAD_ID: NULL
SERVICE_STATE: ON
...
mysql> SELECT * FROM performance_schema.replication_group_member_statsG
*************************** 1. row ***************************
CHANNEL_NAME: group_replication_applier
VIEW_ID: 1428497631:3
MEMBER_ID: e38fdea8-dded-11e4-b211-e8b1fc3848de
COUNT_TRANSACTIONS_IN_QUEUE: 0
COUNT_TRANSACTIONS_CHECKED: 12
COUNT_CONFLICTS_DETECTED: 5
COUNT_TRANSACTIONS_VALIDATING: 6
TRANSACTIONS_COMMITTED_ALL_MEMBERS: 8a84f397-aaa4-18df-89ab-
c70aa9823561:1-7
LAST_CONFLICT_FREE_TRANSACTION: 8a84f397-aaa4-18df-89ab-c70aa9823561:7
mysql> SELECT * FROM performance_schema.replication_group_membersG
*************************** 1. row ***************************
CHANNEL_NAME: group_replication_applier
MEMBER_ID: 597dbb72-3e2c-11e4-9d9d-ecf4bb227f3b
MEMBER_HOST: nightfury
MEMBER_PORT: 13000
MEMBER_STATE: ONLINE
*************************** 2. row ***************************
...
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
Conclusion4
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
Summary
• Cloud Friendly
– Great techonology for deployments where high availability and elasticity is a
requirement, such as Cloud based infrastructures
• Integrated
– With standard MySQL servers through a well defined API
– With standard GTIDs, ROW based replication, and Performance Schema tables
• Autonomic and Operations Friendly
– It is self-healing: no admin overhead for handling server fail-overs
– Provides fault-tolerance: enables multi-master update anywhere and a resilient
distributed MySQL service
• Lab releases provide a sneak peek at what is coming -- a new replication plugin and
exciting new infrastructure: MySQL Group Replication and MySQL Router
24
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
• Strong development cycles and continuous community engagement
through regular lab releases
Releases
25
2015-Apr-06
Labs release: 0.3.0
2014-Aug-06
Labs release: 0.4.0
2015-Sep-14
Labs release: 0.5.0
Introduces new
communication engine!
2015-Oct-22
Labs release: 0.6.0
2016-Jan-13
Labs release: 0.7.0
Introduces Windows Support!
Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. |
Where to Go From Here?
• Packages
– http://labs.mysql.com
• Blogs from the Engineers (news, technical information, and much more)
– http://mysqlhighavailability.com/tag/mysql-group-replication/
26
MySQL Group Replication - an Overview

More Related Content

What's hot (20)

PDF
Sharding and Scale-out using MySQL Fabric
Mats Kindahl
Ā 
PDF
Conference slides: MySQL Cluster Performance Tuning
Severalnines
Ā 
PDF
MySQL Group Replication
Manish Kumar
Ā 
PDF
Mysql User Camp : 20-June-14 : Mysql Fabric
Mysql User Camp
Ā 
PPT
MySQL Cluster Basics
Wagner Bianchi
Ā 
PDF
MySQL Database Architectures - 2020-10
Kenny Gryp
Ā 
PDF
MySQL for Software-as-a-Service (SaaS)
Mario Beck
Ā 
PDF
MySQL Fabric Tutorial, October 2014
Lars Thalmann
Ā 
PDF
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Kenny Gryp
Ā 
PDF
MySQL Fabric: Easy Management of MySQL Servers
Mats Kindahl
Ā 
PDF
MySQL 5.7: What's New, Nov. 2015
Mario Beck
Ā 
PDF
MySQL Replication Performance in the Cloud
Vitor Oliveira
Ā 
PPTX
Making MySQL highly available using Oracle Grid Infrastructure
Ilmar Kerm
Ā 
PDF
MySQL Group Replication - Ready For Production? (2018-04)
Kenny Gryp
Ā 
PDF
MySQL Group Replicatio in a nutshell - MySQL InnoDB Cluster
Frederic Descamps
Ā 
PDF
Upgrade to MySQL 5.6 without downtime
Olivier DASINI
Ā 
PPTX
Proxysql use case scenarios fosdem17
Alkin Tezuysal
Ā 
PDF
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster
Olivier DASINI
Ā 
PDF
MySQL InnoDB Cluster and NDB Cluster
Mario Beck
Ā 
PDF
Fine-tuning Group Replication for Performance
Vitor Oliveira
Ā 
Sharding and Scale-out using MySQL Fabric
Mats Kindahl
Ā 
Conference slides: MySQL Cluster Performance Tuning
Severalnines
Ā 
MySQL Group Replication
Manish Kumar
Ā 
Mysql User Camp : 20-June-14 : Mysql Fabric
Mysql User Camp
Ā 
MySQL Cluster Basics
Wagner Bianchi
Ā 
MySQL Database Architectures - 2020-10
Kenny Gryp
Ā 
MySQL for Software-as-a-Service (SaaS)
Mario Beck
Ā 
MySQL Fabric Tutorial, October 2014
Lars Thalmann
Ā 
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Kenny Gryp
Ā 
MySQL Fabric: Easy Management of MySQL Servers
Mats Kindahl
Ā 
MySQL 5.7: What's New, Nov. 2015
Mario Beck
Ā 
MySQL Replication Performance in the Cloud
Vitor Oliveira
Ā 
Making MySQL highly available using Oracle Grid Infrastructure
Ilmar Kerm
Ā 
MySQL Group Replication - Ready For Production? (2018-04)
Kenny Gryp
Ā 
MySQL Group Replicatio in a nutshell - MySQL InnoDB Cluster
Frederic Descamps
Ā 
Upgrade to MySQL 5.6 without downtime
Olivier DASINI
Ā 
Proxysql use case scenarios fosdem17
Alkin Tezuysal
Ā 
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster
Olivier DASINI
Ā 
MySQL InnoDB Cluster and NDB Cluster
Mario Beck
Ā 
Fine-tuning Group Replication for Performance
Vitor Oliveira
Ā 

Viewers also liked (20)

ODP
MySQL Group Replication
Ulf Wendel
Ā 
PDF
MySQL Group Replication
Kenny Gryp
Ā 
PDF
Advanced mysql replication techniques
Giuseppe Maxia
Ā 
PDF
MySQL InnoDB Cluster - Group Replication
Frederic Descamps
Ā 
ODP
MySQL 5.7 Fabric: Introduction to High Availability and Sharding
Ulf Wendel
Ā 
PDF
HTTP Plugin for MySQL!
Ulf Wendel
Ā 
PDF
FOSSASIA 2015: MySQL Group Replication
Shivji Kumar Jha
Ā 
PDF
Webinar manage MySQL like a devops sysadmin
Frederic Descamps
Ā 
PDF
Group Replication: A Journey to the Group Communication Core
Alfranio JĆŗnior
Ā 
PPTX
The Simple Way to Distribute MySQL Database across Multiple Clouds in Six Con...
GenieDB
Ā 
PPTX
MySQL Options in OpenStack
Tesora
Ā 
PDF
MySQL é«˜åÆē”Øę–¹ę”ˆåŠęˆåŠŸę”ˆä¾‹
郁萍 ēŽ‹
Ā 
PDF
20120426 high availability MySQL
Jui-Nan Lin
Ā 
PDF
MySQL Fabric
Mark Swarbrick
Ā 
PDF
MySQL HA
Mark Swarbrick
Ā 
PDF
MySQL Security Best Practises
Mark Swarbrick
Ā 
PDF
MySQL Group Replication
Bogdan Kecman
Ā 
PPT
SBAAAM, Web Push Notification System V.12
Marco Del Bene
Ā 
PDF
MySQL 5.6 Replication Webinar
Mark Swarbrick
Ā 
PDF
MySQL for Oracle DBA -- Rocky Mountain Oracle User Group Training Days '15
Dave Stokes
Ā 
MySQL Group Replication
Ulf Wendel
Ā 
MySQL Group Replication
Kenny Gryp
Ā 
Advanced mysql replication techniques
Giuseppe Maxia
Ā 
MySQL InnoDB Cluster - Group Replication
Frederic Descamps
Ā 
MySQL 5.7 Fabric: Introduction to High Availability and Sharding
Ulf Wendel
Ā 
HTTP Plugin for MySQL!
Ulf Wendel
Ā 
FOSSASIA 2015: MySQL Group Replication
Shivji Kumar Jha
Ā 
Webinar manage MySQL like a devops sysadmin
Frederic Descamps
Ā 
Group Replication: A Journey to the Group Communication Core
Alfranio JĆŗnior
Ā 
The Simple Way to Distribute MySQL Database across Multiple Clouds in Six Con...
GenieDB
Ā 
MySQL Options in OpenStack
Tesora
Ā 
MySQL é«˜åÆē”Øę–¹ę”ˆåŠęˆåŠŸę”ˆä¾‹
郁萍 ēŽ‹
Ā 
20120426 high availability MySQL
Jui-Nan Lin
Ā 
MySQL Fabric
Mark Swarbrick
Ā 
MySQL HA
Mark Swarbrick
Ā 
MySQL Security Best Practises
Mark Swarbrick
Ā 
MySQL Group Replication
Bogdan Kecman
Ā 
SBAAAM, Web Push Notification System V.12
Marco Del Bene
Ā 
MySQL 5.6 Replication Webinar
Mark Swarbrick
Ā 
MySQL for Oracle DBA -- Rocky Mountain Oracle User Group Training Days '15
Dave Stokes
Ā 
Ad

Similar to MySQL Group Replication - an Overview (20)

PDF
Everything You Need to Know About MySQL Group Replication
Nuno Carvalho
Ā 
PDF
Hkosc group replication-lecture_lab07
Ivan Ma
Ā 
PDF
MySQL Group Replication - HandsOn Tutorial
Kenny Gryp
Ā 
PDF
Confoo 202 - MySQL Group Replication and ReplicaSet
Dave Stokes
Ā 
PDF
MySQL InnoDB Cluster: High Availability Made Easy!
Vittorio Cioe
Ā 
ODP
MySQL Group Replication @osi days 2014
Manish Kumar
Ā 
PDF
DataOpsbarcelona 2019: Deep dive into MySQL Group Replication... the magic e...
Frederic Descamps
Ā 
PDF
Replication Whats New in Mysql 8
LuĆ­s Soares
Ā 
PDF
MySQL Day Paris 2018 - MySQL InnoDB Cluster; A complete High Availability sol...
Olivier DASINI
Ā 
PDF
20190817 coscup-oracle my sql innodb cluster sharing
Ivan Ma
Ā 
PDF
MySQL innodb cluster and Group Replication in a nutshell - hands-on tutorial ...
Frederic Descamps
Ā 
PDF
MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
Sujatha Sivakumar
Ā 
PDF
MySQL Replication Update -- Zendcon 2016
Dave Stokes
Ā 
PDF
Introduction to MySQL InnoDB Cluster
Frederic Descamps
Ā 
PDF
MySQL InnoDB Cluster and Group Replication in a nutshell hands-on tutorial
Frederic Descamps
Ā 
PDF
Introduction to MySQL InnoDB Cluster
Frederic Descamps
Ā 
PDF
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
Kenny Gryp
Ā 
PDF
Group Replication in MySQL 8.0 ( A Walk Through )
Mydbops
Ā 
PDF
Sunshine php my sql 8.0 v2
Kathy Forte (Hassard)
Ā 
PDF
MySQL InnoDB Cluster and Group Replication in a Nutshell
Frederic Descamps
Ā 
Everything You Need to Know About MySQL Group Replication
Nuno Carvalho
Ā 
Hkosc group replication-lecture_lab07
Ivan Ma
Ā 
MySQL Group Replication - HandsOn Tutorial
Kenny Gryp
Ā 
Confoo 202 - MySQL Group Replication and ReplicaSet
Dave Stokes
Ā 
MySQL InnoDB Cluster: High Availability Made Easy!
Vittorio Cioe
Ā 
MySQL Group Replication @osi days 2014
Manish Kumar
Ā 
DataOpsbarcelona 2019: Deep dive into MySQL Group Replication... the magic e...
Frederic Descamps
Ā 
Replication Whats New in Mysql 8
LuĆ­s Soares
Ā 
MySQL Day Paris 2018 - MySQL InnoDB Cluster; A complete High Availability sol...
Olivier DASINI
Ā 
20190817 coscup-oracle my sql innodb cluster sharing
Ivan Ma
Ā 
MySQL innodb cluster and Group Replication in a nutshell - hands-on tutorial ...
Frederic Descamps
Ā 
MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
Sujatha Sivakumar
Ā 
MySQL Replication Update -- Zendcon 2016
Dave Stokes
Ā 
Introduction to MySQL InnoDB Cluster
Frederic Descamps
Ā 
MySQL InnoDB Cluster and Group Replication in a nutshell hands-on tutorial
Frederic Descamps
Ā 
Introduction to MySQL InnoDB Cluster
Frederic Descamps
Ā 
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
Kenny Gryp
Ā 
Group Replication in MySQL 8.0 ( A Walk Through )
Mydbops
Ā 
Sunshine php my sql 8.0 v2
Kathy Forte (Hassard)
Ā 
MySQL InnoDB Cluster and Group Replication in a Nutshell
Frederic Descamps
Ā 
Ad

More from Matt Lord (11)

PPTX
Vitess VReplication: Standing on the Shoulders of a MySQL Giant
Matt Lord
Ā 
PPTX
MongDB Mobile: Bringing the Power of MongoDB to Your Device
Matt Lord
Ā 
PPTX
MongoDB Mobile: Bringing the Power of MongoDB to Your Device
Matt Lord
Ā 
PPTX
Using MySQL Containers
Matt Lord
Ā 
PDF
Unlocking Big Data Insights with MySQL
Matt Lord
Ā 
PDF
OpenStack Days East -- MySQL Options in OpenStack
Matt Lord
Ā 
PDF
OpenStack and MySQL
Matt Lord
Ā 
PPTX
MySQL DBaaS with OpenStack Trove
Matt Lord
Ā 
PPTX
Getting Started with MySQL Full Text Search
Matt Lord
Ā 
PPTX
Using MySQL in the Cloud
Matt Lord
Ā 
PDF
MySQL 5.7 GIS
Matt Lord
Ā 
Vitess VReplication: Standing on the Shoulders of a MySQL Giant
Matt Lord
Ā 
MongDB Mobile: Bringing the Power of MongoDB to Your Device
Matt Lord
Ā 
MongoDB Mobile: Bringing the Power of MongoDB to Your Device
Matt Lord
Ā 
Using MySQL Containers
Matt Lord
Ā 
Unlocking Big Data Insights with MySQL
Matt Lord
Ā 
OpenStack Days East -- MySQL Options in OpenStack
Matt Lord
Ā 
OpenStack and MySQL
Matt Lord
Ā 
MySQL DBaaS with OpenStack Trove
Matt Lord
Ā 
Getting Started with MySQL Full Text Search
Matt Lord
Ā 
Using MySQL in the Cloud
Matt Lord
Ā 
MySQL 5.7 GIS
Matt Lord
Ā 

Recently uploaded (20)

PPTX
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
Ā 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
Ā 
PPTX
Comprehensive Guide: Shoviv Exchange to Office 365 Migration Tool 2025
Shoviv Software
Ā 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
Ā 
PDF
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
Ā 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
Ā 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
Ā 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
Ā 
PDF
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
Ā 
PDF
ģœ ė‹ˆķ‹°ģ—ģ„œ Burst Compiler+ThreadedJobs+SIMD ģ ģš©ģ‚¬ė”€
Seongdae Kim
Ā 
PPTX
Revolutionizing Code Modernization with AI
KrzysztofKkol1
Ā 
PDF
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
Ā 
PPTX
Platform for Enterprise Solution - Java EE5
abhishekoza1981
Ā 
PPTX
Human Resources Information System (HRIS)
Amity University, Patna
Ā 
PPTX
How Apagen Empowered an EPC Company with Engineering ERP Software
SatishKumar2651
Ā 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
Ā 
PDF
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
Ā 
PPTX
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
Ā 
PPT
MergeSortfbsjbjsfk sdfik k
RafishaikIT02044
Ā 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
Ā 
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
Ā 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
Ā 
Comprehensive Guide: Shoviv Exchange to Office 365 Migration Tool 2025
Shoviv Software
Ā 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
Ā 
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
Ā 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
Ā 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
Ā 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
Ā 
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
Ā 
ģœ ė‹ˆķ‹°ģ—ģ„œ Burst Compiler+ThreadedJobs+SIMD ģ ģš©ģ‚¬ė”€
Seongdae Kim
Ā 
Revolutionizing Code Modernization with AI
KrzysztofKkol1
Ā 
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
Ā 
Platform for Enterprise Solution - Java EE5
abhishekoza1981
Ā 
Human Resources Information System (HRIS)
Amity University, Patna
Ā 
How Apagen Empowered an EPC Company with Engineering ERP Software
SatishKumar2651
Ā 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
Ā 
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
Ā 
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
Ā 
MergeSortfbsjbjsfk sdfik k
RafishaikIT02044
Ā 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
Ā 

MySQL Group Replication - an Overview

  • 1. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | MySQL Group Replication An Overview 1
  • 2. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 2
  • 3. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | Program Agenda
  • 4. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | Program Agenda The Theory How It Works How to Use It Conclusion 1 2 3 4 4
  • 5. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | The Theory1
  • 6. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | M S S S S M write clients read clients read clients write clients More reads? More slaves! Read scale-out Background: What is Replication Used For? 6
  • 7. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | C B A C B ACrash C B A B is the new master Uh Oh! Whew! Redundancy: If master crashes, promote slave to master Background: What is Replication Used For? 7
  • 8. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | MySQL Group Replication 8 M M M M M Replication Group Clients
  • 9. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | MySQL Group Replication • What is MySQL Group Replication? ā€œMulti-master update anywhere replication plugin for MySQL with built-in automatic distributed recovery, conflict detection, and group membership.ā€ • What does the MySQL Group Replication plugin do for the user? – Removes the need for manually handling server fail-over – Provides distributed fault tolerance – Enables Active/Active update anywhere setups – Automates group reconfiguration (handling of crashes, failures, re-connects) – Provides a highly available distributed database service 9
  • 10. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | Use Cases • Elastic Replication – Environments that require a very fluid replication infrastructure, where the number of servers has to grow or shrink dynamically and with as little manual intervention as possible. • Highly Available Shards – Sharding is a popular approach to achieve write scale-out. Users can use MySQL Group Replication to implement highly available shards. Each shard can map to an individual Replication Group. • Alternative to Master-Slave Replication – It may be that a single master server makes it a single point of contention. Writing to an entire group may prove more scalable under certain circumstances. 10
  • 11. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | The Theory Behind It • Implementation is based on ā€œReplicated Database State Machinesā€ – Group Communication primitives resemble general properties of Databases – Distributed systems meet Databases: Pedone, Guerraoui, and Schiper paper • Deferred update replication: before committing locally we certify it on all nodes – In order to implement it one needs Atomic Broadcast – the change occurs everywhere or nowhere – This is necessary to ensure data consistency across all nodes • Membership Service – Group Membership: it allows one to know that at a given moment in time all the members that are participating in the protocol are associated with the same logical identifier (view id) – View Synchrony: ensure that messages from past views are all delivered before a new view is installed 11
  • 12. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | How It Works2
  • 13. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | Example: Adding a Node to an Existing Group • Create a user for automated distributed recovery: • Server needs to be started with a valid configuration: 13 ./bin/mysqld --no-defaults --basedir=. --datadir=<DATADIR_LOCATION> –P <PORT> --socket=mysqld<ID>.sock --log-bin=master-bin --server-id=<ID> --gtid-mode=on --enforce-gtid-consistency --log-slave-updates --binlog-checksum=NONE --binlog-format=row --master-info-repository=TABLE --relay-log-info-repository=TABLE --transaction-write-set-extraction=MURMUR32 --plugin-dir=lib/plugin --plugin-load=group_replication.so ./bin/mysql -uroot -h 127.0.0.1 -P 13001 -p --prompt='server1>' server1> CREATE USER 'rpl_user'@'%' IDENTIFIED BY 'rpl_pass'; GRANT REPLICATION SLAVE ON *.* TO rpl_user@'%';
  • 14. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | Example: Adding a Node to an Existing Group (2) • Now lets configure the replication user used for recovery: • Now the group communication backbone: 14 SET GLOBAL group_replication_recovery_user='rpl_user'; SET GLOBAL group_replication_recovery_password='rpl_pass'; SET GLOBAL group_replication_group_name= <valid UUID>; SET GLOBAL group_replication_local_address=<this node address:port for the communication backbone>; SET GLOBAL group_replication_peer_addresses= <comma-separated list of all other nodes in the group>; SET GLOBAL group_replication_bootstrap_group= 0;
  • 15. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | Example: Adding a Node to an Existing Group (3) • Server that joins the group will automatically synchronize with the others • It will retrieve the diff between its data and the rest of the group • Hint: provision the new node with base data (i.e. restore a backup) before joining an existing group 15 M M M M M N I want to join the group START GROUP_REPLICATION; ONLINE
  • 16. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | Example: Adding a Node to an Existing Group (4) 16 M M M M M N ONLINE RECOVERING SELECT * FROM performance_schema.replication_group_membersG M M M M M N ONLINE
  • 17. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | Example: Automated Group Membership • If a server leaves the group, the others will automatically be informed 17 M M M M M M My machine needs maintenance or a system crash happens Each membership configuration is identified by a view_id view_id: 4 STOP GROUP_REPLICATION;
  • 18. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | Example: Automated Group Membership (2) • If a server leaves the group, the others will automatically be informed • Server that (re)joins the group will automatically synch with the others 18 M M M M M view_id: 5 M M M M M M RECOVERING -> ONLINE view_id: 6
  • 19. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | How to Use It3
  • 20. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | Multi-Master Update Anywhere! • Any two transactions on different servers can write to the same row • Conflicts will automatically be detected and handled – First committer wins rule 20 M M M M M UPDATE t1 SET a=4 WHERE a=2UPDATE t1 SET a=3 WHERE a=1 OKOK M M M M M UPDATE t1 SET a=2 WHERE a=1UPDATE t1 SET a=3 WHERE a=1 OK
  • 21. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | Full GTID Support • All group members share the same UUID, which is the group name 21 M M M M M INSERT y; Will have GTID: group_name:2 INSERT x; Will have GTID: group_name:1
  • 22. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | Monitoring the Replication Group • Monitor group health and stats using Performance Schema tables 22 mysql> SELECT * FROM performance_schema.replication_connection_statusG *************************** 1. row *************************** CHANNEL_NAME: group_replication_applier GROUP_NAME: 8a94f357-aab4-11df-86ab-c80aa9429563 SOURCE_UUID: 8a94f357-aab4-11df-86ab-c80aa9429563 THREAD_ID: NULL SERVICE_STATE: ON ... mysql> SELECT * FROM performance_schema.replication_group_member_statsG *************************** 1. row *************************** CHANNEL_NAME: group_replication_applier VIEW_ID: 1428497631:3 MEMBER_ID: e38fdea8-dded-11e4-b211-e8b1fc3848de COUNT_TRANSACTIONS_IN_QUEUE: 0 COUNT_TRANSACTIONS_CHECKED: 12 COUNT_CONFLICTS_DETECTED: 5 COUNT_TRANSACTIONS_VALIDATING: 6 TRANSACTIONS_COMMITTED_ALL_MEMBERS: 8a84f397-aaa4-18df-89ab- c70aa9823561:1-7 LAST_CONFLICT_FREE_TRANSACTION: 8a84f397-aaa4-18df-89ab-c70aa9823561:7 mysql> SELECT * FROM performance_schema.replication_group_membersG *************************** 1. row *************************** CHANNEL_NAME: group_replication_applier MEMBER_ID: 597dbb72-3e2c-11e4-9d9d-ecf4bb227f3b MEMBER_HOST: nightfury MEMBER_PORT: 13000 MEMBER_STATE: ONLINE *************************** 2. row *************************** ...
  • 23. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | Conclusion4
  • 24. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | Summary • Cloud Friendly – Great techonology for deployments where high availability and elasticity is a requirement, such as Cloud based infrastructures • Integrated – With standard MySQL servers through a well defined API – With standard GTIDs, ROW based replication, and Performance Schema tables • Autonomic and Operations Friendly – It is self-healing: no admin overhead for handling server fail-overs – Provides fault-tolerance: enables multi-master update anywhere and a resilient distributed MySQL service • Lab releases provide a sneak peek at what is coming -- a new replication plugin and exciting new infrastructure: MySQL Group Replication and MySQL Router 24
  • 25. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | • Strong development cycles and continuous community engagement through regular lab releases Releases 25 2015-Apr-06 Labs release: 0.3.0 2014-Aug-06 Labs release: 0.4.0 2015-Sep-14 Labs release: 0.5.0 Introduces new communication engine! 2015-Oct-22 Labs release: 0.6.0 2016-Jan-13 Labs release: 0.7.0 Introduces Windows Support!
  • 26. Copyright Ā© 2016, Oracle and/or its affiliates. All rights reserved. | Where to Go From Here? • Packages – http://labs.mysql.com • Blogs from the Engineers (news, technical information, and much more) – http://mysqlhighavailability.com/tag/mysql-group-replication/ 26