SlideShare a Scribd company logo
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Mix ‘n’ Match Async and Group Replication for Advanced
Replication Setups
Pedro Gomes (pedro.gomes@oracle.com)
Software Engineer
4th of February Oracle / Fosdem 2017 1
Copyright © 2017, 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.
24th of February Oracle / Fosdem 2017
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Program Agenda
4th of February Oracle / Fosdem 2017
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Background
Mix it!
Migrations
Conclusion
Program Agenda
4th of February Oracle / Fosdem 2017 4
1
2
3
4
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Background
4th of February Oracle / Fosdem 2017
1
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
In the beggining there was Async Replication
64th of February Oracle / Fosdem 2017
S1 S2 S3
Master
MySQL Connector
Application
MySQL Connector
Application
Writes
Reads
Async replication
connection
In the beginning there was asynchronous
replication. You write in the master where
events are logged and sent to the slaves
where they are queued and applied.
This can be used for data safety on master
crashes or read scalability
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Semi sync Replication
74th of February Oracle / Fosdem 2017
S1 S2 S3
Master
MySQL Connector
Application
MySQL Connector
Application
ACK
ACK
On 5.5 we introduced semi sync. The idea
is that when the master commits it waits
for the slaves to queue the transaction or
to prepare the commit.
You can wait on all or on a set number of
slaves.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Multi Source Replication
84th of February Oracle / Fosdem 2017
S1 S2 S3
Master
MySQL Connector
Application
MySQL Connector
Application
Master
MySQL Connector
Application
On early 5.7 we introduced Multi source.
It introduced the notion of channel, i.e., a
replication sources.
Slaves can now have different channels
that will receive data from different
masters. Conflicts are not detected.
This can be used for data aggregation or
full backups of sharded data
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Group Replication
94th of February Oracle / Fosdem 2017
Master
MySQL Connector
Application
MySQL Connector
Application
Master
MySQL Connector
Application
Master
Group
We now present Group replication.
When you write in a member, the
information flows to the other members in
a ordered way, meaning all members get
the same transactions in the same order.
More on the next slide
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL Group Replication
• What is MySQL Group Replication?
“Multi-master update everywhere 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 handling server fail-over.
– Provides fault tolerance.
– Enables update everywhere setups.
– Automates group reconfiguration (handling of crashes, failures, re-connects).
– Provides a highly available replicated database.
104th of February Oracle / Fosdem 2017
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Mix it!
4th of February Oracle / Fosdem 2017
2
2.1 Basic scenarios
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Read out Scalability
124th of February Oracle / Fosdem 2017
Master
MySQL Connector
Application
MySQL Connector
Application
Master
MySQL Connector
Application
Master
S1 S2 S3
If you are afraid of the 9 members
limitation and you want to scale your
reads, you can add more slaves that
replicate from the group.
Remember that the group has automatic
failover, but not your slaves.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Aggregate some data
134th of February Oracle / Fosdem 2017
Master
MySQL Connector
Applicaton
Master
Master
S
Master Master
Master
Multi source can also be used to aggregate
data from 2 groups.
Again you can do some data analyses or
have a full backup of your data.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Mix it!
4th of February Oracle / Fosdem 2017
2
2.2 Advanced scenarios
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Inter data center replication
154th of February Oracle / Fosdem 2017
Master Master
Master
Master Master
Master
If you have different groups on different
databases you can still replication from
one to another using asynchronous
replication.
Here we use 2 pairs of servers to share the
load of this task among the members, but
you can use only one circular pair or have
even more connections if desired.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Migrations
4th of February Oracle / Fosdem 2017
3
How to migrate from asynchronous replication3.1
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
How to migrate from asynchronous scenarios
174th of February Oracle / Fosdem 2017
Master
Master Master
Master
S1 S2
?
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
How to migrate from asynchronous scenarios
184th of February Oracle / Fosdem 2017
M1
M2
S1 S2
MySQL Connector
Application Here I chose to start the group in a new
provisioned member but you can also
start by doing this in on of the existing
slaves .
M2 will replicate from M1 using async
replication.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
How to migrate from asynchronous scenarios
194th of February Oracle / Fosdem 2017
M1
M2
S1
S2
MySQL Connector
Application
On by one you can start moving the slaves
into the group. As all info applied into M1
is disseminated to the group, you can
starting migrating reads to it and the
migrated slaves.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
How to migrate from asynchronous scenarios
204th of February Oracle / Fosdem 2017
M1
M2 S2
MySQL Connector
Application
S1
Eventually all slaves will be migrated to
the group. Now comes the trick part.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
How to migrate from asynchronous scenarios
214th of February Oracle / Fosdem 2017
M1
M2 S2
MySQL Connector
Application
S1
If your workload allows it, start migrating
some writes to the group gradually. If not,
you need to wait for the delay from M1 to
M2 to be nearly 0, block writes on M1 and
then switch to M2 when that last N
transactions from M1 are replicated.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
How to migrate from asynchronous scenarios
224th of February Oracle / Fosdem 2017
M1
M2
S2
MySQL Connector
Application
S1
Now you just need to add M1 to the group.
Distributed recovery will make the member
catch up to the writes it missed in the
transition to the group.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Migrations
4th of February Oracle / Fosdem 2017
3
Different servers3.2
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Migrate disjoint servers into Group replication
244th of February Oracle / Fosdem 2017
M1
MySQL Connector
Application
M2
MySQL Connector
Application
This one is a less common case, but still
interesting as a migration example.
What if you want to merge shards or two
applications into a group to make it HA?
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Migrate disjoint servers into Group replication
254th of February Oracle / Fosdem 2017
M1
MySQL Connector
Application
M2
MySQL Connector
Application
Start replicating from one of the servers into the
other.
One thing to consider here: the member that
becomes a slave has to deal with this increased load,
but on the other hand, we must eventually block
writes to the M1 for a brief moment.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Migrate disjoint servers into Group replication
264th of February Oracle / Fosdem 2017
M1
MySQL Connector
Application
M2
MySQL Connector
Application
Start a group with M2
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Migrate disjoint servers into Group replication
274th of February Oracle / Fosdem 2017
M1
MySQL Connector
Application
M2
MySQL Connector
Application
M3
We add a new member here for 2 reasons:
1. The resulting group with only two members, M1
and M2, could suffer from split brain problems if
one of them died.
2. There is a moment where M1 will stop serving
requests and at that moment M2 would take all
the load alone.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Migrate disjoint servers into Group replication
284th of February Oracle / Fosdem 2017
M1
MySQL Connector
Application
M2
MySQL Connector
Application
M3
If your workload allows it, start migrating
some M1 writes to the group gradually. If
not, you need to wait for the delay from M1
to M2 to be nearly 0, block writes on M1
and then switch to M2 when that last N
transactions are replicated.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Migrate disjoint servers into Group replication
294th of February Oracle / Fosdem 2017
M1
MySQL Connector
Application
M2
MySQL Connector
Application
M3
You can now join M1 to the group, being
probably best to do some provisioning here
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Migrate disjoint servers into Group replication (alternative)
304th of February Oracle / Fosdem 2017
M1
MySQL Connector
Application
M2
MySQL Connector
Application
S
Another alternative is to add a multi source
slave that will replicate from both members.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Migrate disjoint servers into Group replication (alternative)
314th of February Oracle / Fosdem 2017
M1
MySQL Connector
Application
M2
MySQL Connector
Application
S
Start a new group on this slave.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Migrate disjoint servers into Group replication (alternative)
324th of February Oracle / Fosdem 2017
M1
MySQL Connector
Application
M2
MySQL Connector
Application
S
If your workload allows it, start migrating
some writes to S gradually. If not, you need
to wait for the delay from M2 to S to be
nearly 0, block writes on M2 and then
switch to S.
Add M2 to the group.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Migrate disjoint servers into Group replication (alternative)
334th of February Oracle / Fosdem 2017
M1
MySQL Connector
Application
M2
MySQL Connector
Application
S
When M2 can take writes from its original
application repeat the previous step with
M1.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Migrations
4th of February Oracle / Fosdem 2017
3
Going Back3.3
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
From Group Replication to Asynchronous topologies
354th of February Oracle / Fosdem 2017
M2
M1
MySQL Connector
Application
M3
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
From Group Replication to Asynchronous topologies
364th of February Oracle / Fosdem 2017
M2
M1
MySQL Connector
Application
S3
Just stop group replication in one member
and configure it as a slave of the one the
original members.
If using multi master direct all writes to this
member that is now a master.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
From Group Replication to Asynchronous topologies
374th of February Oracle / Fosdem 2017
S2
M1
MySQL Connector
Application
S3
Repeat the same process for the other
members until only the master remains in
the group. At that point stop group
replication on the master as well.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Conclusion
4th of February Oracle / Fosdem 2017
4
This presentation only contains examples of
possible setups. Other possibilities may
exist, just try it
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Where to go from here?
• GA Packages
– http://www.mysql.com/downloads/
• Documentation
– http://dev.mysql.com/doc/refman/5.7/en/group-replication.html
• Blogs from the Engineers (news, technical information, and much more)
– http://mysqlhighavailability.com
394th of February Oracle / Fosdem 2017
Mix ‘n’ Match Async and Group Replication for Advanced Replication Setups
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.4th of February Oracle / Fosdem 2017 41
@distributedpete
Twitter:
Thanks!

More Related Content

What's hot (20)

PDF
Everything You Need to Know About MySQL Group Replication
Nuno Carvalho
 
PDF
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Continuent
 
PDF
MySQL Replication Performance in the Cloud
Vitor Oliveira
 
PDF
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
Ivan Ma
 
PDF
Boston meetup : MySQL Innodb Cluster - May 1st 2017
Frederic Descamps
 
PDF
Introduction to MySQL InnoDB Cluster
Frederic Descamps
 
PDF
MySQL Group Replication - an Overview
Matt Lord
 
PDF
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
Kenny Gryp
 
PDF
MySQL Database Architectures - 2020-10
Kenny Gryp
 
PDF
Introduction to MySQL InnoDB Cluster
Frederic Descamps
 
PDF
MySQL InnoDB Cluster - Group Replication
Frederic Descamps
 
PDF
MySQL Group Replicatio in a nutshell - MySQL InnoDB Cluster
Frederic Descamps
 
PDF
MySQL Group Replication - Ready For Production? (2018-04)
Kenny Gryp
 
PDF
MySQL Connectors 8.0.19 & DNS SRV
Kenny Gryp
 
PDF
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11
Kenny Gryp
 
PPTX
Using MySQL Containers
Matt Lord
 
PDF
Building Scalable High Availability Systems using MySQL Fabric
Mats Kindahl
 
PDF
Helsinki MySQL User Group - MySQL InnoDB Cluster
Frederic Descamps
 
PDF
MySQL InnoDB Cluster and Group Replication in a Nutshell
Frederic Descamps
 
PDF
Introduction to MySQL InnoDB Cluster
Frederic Descamps
 
Everything You Need to Know About MySQL Group Replication
Nuno Carvalho
 
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Continuent
 
MySQL Replication Performance in the Cloud
Vitor Oliveira
 
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
Ivan Ma
 
Boston meetup : MySQL Innodb Cluster - May 1st 2017
Frederic Descamps
 
Introduction to MySQL InnoDB Cluster
Frederic Descamps
 
MySQL Group Replication - an Overview
Matt Lord
 
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
Kenny Gryp
 
MySQL Database Architectures - 2020-10
Kenny Gryp
 
Introduction to MySQL InnoDB Cluster
Frederic Descamps
 
MySQL InnoDB Cluster - Group Replication
Frederic Descamps
 
MySQL Group Replicatio in a nutshell - MySQL InnoDB Cluster
Frederic Descamps
 
MySQL Group Replication - Ready For Production? (2018-04)
Kenny Gryp
 
MySQL Connectors 8.0.19 & DNS SRV
Kenny Gryp
 
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11
Kenny Gryp
 
Using MySQL Containers
Matt Lord
 
Building Scalable High Availability Systems using MySQL Fabric
Mats Kindahl
 
Helsinki MySQL User Group - MySQL InnoDB Cluster
Frederic Descamps
 
MySQL InnoDB Cluster and Group Replication in a Nutshell
Frederic Descamps
 
Introduction to MySQL InnoDB Cluster
Frederic Descamps
 

Viewers also liked (20)

PDF
Reducing Risk When Upgrading MySQL
Kenny Gryp
 
PDF
SQL Outer Joins for Fun and Profit
Karwin Software Solutions LLC
 
PPTX
Mysql参数-GDB
zhaolinjnu
 
PPTX
High Availability Using MySQL Group Replication
OSSCube
 
PDF
Multi Source Replication With MySQL 5.7 @ Verisure
Kenny Gryp
 
PPTX
2010丹臣的思考
zhaolinjnu
 
PDF
Capturing, Analyzing and Optimizing MySQL
Ronald Bradford
 
PDF
A New Architecture for Group Replication in Data Grid
Editor IJCATR
 
PDF
Advanced Percona XtraDB Cluster in a nutshell... la suite
Kenny Gryp
 
PDF
Java MySQL Connector & Connection Pool Features & Optimization
Kenny Gryp
 
PDF
MySQL Group Replication
Manish Kumar
 
PDF
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Kenny Gryp
 
PDF
Мониторинг и отладка MySQL: максимум информации при минимальных потерях
Sveta Smirnova
 
PDF
MySQL Storage Engines - which do you use? TokuDB? MyRocks? InnoDB?
Sveta Smirnova
 
PDF
MHA (MySQL High Availability): Getting started & moving past quirks
Colin Charles
 
PDF
MySQL Best Practices - OTN LAD Tour
Ronald Bradford
 
PDF
MySQL Group Replication
Kenny Gryp
 
PDF
MySQL 5.7: Focus on InnoDB
Mario Beck
 
PDF
Extensible Data Modeling
Karwin Software Solutions LLC
 
PDF
Inno db internals innodb file formats and source code structure
zhaolinjnu
 
Reducing Risk When Upgrading MySQL
Kenny Gryp
 
SQL Outer Joins for Fun and Profit
Karwin Software Solutions LLC
 
Mysql参数-GDB
zhaolinjnu
 
High Availability Using MySQL Group Replication
OSSCube
 
Multi Source Replication With MySQL 5.7 @ Verisure
Kenny Gryp
 
2010丹臣的思考
zhaolinjnu
 
Capturing, Analyzing and Optimizing MySQL
Ronald Bradford
 
A New Architecture for Group Replication in Data Grid
Editor IJCATR
 
Advanced Percona XtraDB Cluster in a nutshell... la suite
Kenny Gryp
 
Java MySQL Connector & Connection Pool Features & Optimization
Kenny Gryp
 
MySQL Group Replication
Manish Kumar
 
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Kenny Gryp
 
Мониторинг и отладка MySQL: максимум информации при минимальных потерях
Sveta Smirnova
 
MySQL Storage Engines - which do you use? TokuDB? MyRocks? InnoDB?
Sveta Smirnova
 
MHA (MySQL High Availability): Getting started & moving past quirks
Colin Charles
 
MySQL Best Practices - OTN LAD Tour
Ronald Bradford
 
MySQL Group Replication
Kenny Gryp
 
MySQL 5.7: Focus on InnoDB
Mario Beck
 
Extensible Data Modeling
Karwin Software Solutions LLC
 
Inno db internals innodb file formats and source code structure
zhaolinjnu
 
Ad

Similar to Mix ‘n’ Match Async and Group Replication for Advanced Replication Setups (20)

PDF
Confoo 202 - MySQL Group Replication and ReplicaSet
Dave Stokes
 
PDF
MySQL InnoDB Cluster: High Availability Made Easy!
Vittorio Cioe
 
PDF
Introduction to MySQL InnoDB Cluster
Frederic Descamps
 
PPTX
MySQL High Availability Solutions - Feb 2015 webinar
Andrew Morgan
 
DOCX
Master master vs master-slave database
Wipro
 
PPTX
MySQL High Availibility Solutions
Mark Swarbrick
 
PDF
Swedish MySQL User Group - MySQL InnoDB Cluster
Frederic Descamps
 
PDF
Moodle Moot Spain: Moodle Available and Scalable with MySQL HA - InnoDB Clust...
Keith Hollman
 
PDF
1 architecture & design
Mark Swarbrick
 
PDF
FOSSASIA 2015: MySQL Group Replication
Shivji Kumar Jha
 
PDF
MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
Sujatha Sivakumar
 
PDF
Scaling MySQL -- Swanseacon.co.uk
Dave Stokes
 
PDF
20190817 coscup-oracle my sql innodb cluster sharing
Ivan Ma
 
PDF
MySQL High Availability -- InnoDB Clusters
Matt Lord
 
PDF
MySQL 5.6 Replication Webinar
Mark Swarbrick
 
PDF
MySQL Group Replication
Bogdan Kecman
 
PDF
MySQL 8.0 InnoDB Cluster - Easiest Tutorial
Frederic Descamps
 
PDF
Oracle Open World 2018 / Code One : MySQL 8.0 High Availability with MySQL I...
Frederic Descamps
 
PDF
MySQL High Availability Solutions - Avoid loss of service by reducing the r...
Olivier DASINI
 
PPTX
MySQL - Scale Out @ CloudParty 2013 Milano Talent Garden
Corley S.r.l.
 
Confoo 202 - MySQL Group Replication and ReplicaSet
Dave Stokes
 
MySQL InnoDB Cluster: High Availability Made Easy!
Vittorio Cioe
 
Introduction to MySQL InnoDB Cluster
Frederic Descamps
 
MySQL High Availability Solutions - Feb 2015 webinar
Andrew Morgan
 
Master master vs master-slave database
Wipro
 
MySQL High Availibility Solutions
Mark Swarbrick
 
Swedish MySQL User Group - MySQL InnoDB Cluster
Frederic Descamps
 
Moodle Moot Spain: Moodle Available and Scalable with MySQL HA - InnoDB Clust...
Keith Hollman
 
1 architecture & design
Mark Swarbrick
 
FOSSASIA 2015: MySQL Group Replication
Shivji Kumar Jha
 
MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
Sujatha Sivakumar
 
Scaling MySQL -- Swanseacon.co.uk
Dave Stokes
 
20190817 coscup-oracle my sql innodb cluster sharing
Ivan Ma
 
MySQL High Availability -- InnoDB Clusters
Matt Lord
 
MySQL 5.6 Replication Webinar
Mark Swarbrick
 
MySQL Group Replication
Bogdan Kecman
 
MySQL 8.0 InnoDB Cluster - Easiest Tutorial
Frederic Descamps
 
Oracle Open World 2018 / Code One : MySQL 8.0 High Availability with MySQL I...
Frederic Descamps
 
MySQL High Availability Solutions - Avoid loss of service by reducing the r...
Olivier DASINI
 
MySQL - Scale Out @ CloudParty 2013 Milano Talent Garden
Corley S.r.l.
 
Ad

Recently uploaded (20)

PDF
AWS Consulting Services: Empowering Digital Transformation with Nlineaxis
Nlineaxis IT Solutions Pvt Ltd
 
PPTX
NeuroStrata: Harnessing Neuro-Symbolic Paradigms for Improved Testability and...
Ivan Ruchkin
 
PPTX
Cubase Pro Crack 2025 – Free Download Full Version with Activation Key
HyperPc soft
 
PDF
Difference Between Kubernetes and Docker .pdf
Kindlebit Solutions
 
PPTX
A Complete Guide to Salesforce SMS Integrations Build Scalable Messaging With...
360 SMS APP
 
PPTX
ERP - FICO Presentation BY BSL BOKARO STEEL LIMITED.pptx
ravisranjan
 
PPTX
IObit Uninstaller Pro 14.3.1.8 Crack Free Download 2025
sdfger qwerty
 
PDF
Laboratory Workflows Digitalized and live in 90 days with Scifeon´s SAPPA P...
info969686
 
PDF
Power BI vs Tableau vs Looker - Which BI Tool is Right for You?
MagnusMinds IT Solution LLP
 
PPTX
Quality on Autopilot: Scaling Testing in Uyuni
Oscar Barrios Torrero
 
PPTX
EO4EU Ocean Monitoring: Maritime Weather Routing Optimsation Use Case
EO4EU
 
PPTX
IObit Driver Booster Pro Crack Download Latest Version
chaudhryakashoo065
 
PPTX
ManageIQ - Sprint 264 Review - Slide Deck
ManageIQ
 
PPTX
Iobit Driver Booster Pro 12 Crack Free Download
chaudhryakashoo065
 
PPTX
Mistakes to Avoid When Selecting Policy Management Software
Insurance Tech Services
 
PDF
GridView,Recycler view, API, SQLITE& NetworkRequest.pdf
Nabin Dhakal
 
PDF
capitulando la keynote de GrafanaCON 2025 - Madrid
Imma Valls Bernaus
 
PPTX
MiniTool Power Data Recovery Full Crack Latest 2025
muhammadgurbazkhan
 
PDF
>Nitro Pro Crack 14.36.1.0 + Keygen Free Download [Latest]
utfefguu
 
PPTX
For my supp to finally picking supp that work
necas19388
 
AWS Consulting Services: Empowering Digital Transformation with Nlineaxis
Nlineaxis IT Solutions Pvt Ltd
 
NeuroStrata: Harnessing Neuro-Symbolic Paradigms for Improved Testability and...
Ivan Ruchkin
 
Cubase Pro Crack 2025 – Free Download Full Version with Activation Key
HyperPc soft
 
Difference Between Kubernetes and Docker .pdf
Kindlebit Solutions
 
A Complete Guide to Salesforce SMS Integrations Build Scalable Messaging With...
360 SMS APP
 
ERP - FICO Presentation BY BSL BOKARO STEEL LIMITED.pptx
ravisranjan
 
IObit Uninstaller Pro 14.3.1.8 Crack Free Download 2025
sdfger qwerty
 
Laboratory Workflows Digitalized and live in 90 days with Scifeon´s SAPPA P...
info969686
 
Power BI vs Tableau vs Looker - Which BI Tool is Right for You?
MagnusMinds IT Solution LLP
 
Quality on Autopilot: Scaling Testing in Uyuni
Oscar Barrios Torrero
 
EO4EU Ocean Monitoring: Maritime Weather Routing Optimsation Use Case
EO4EU
 
IObit Driver Booster Pro Crack Download Latest Version
chaudhryakashoo065
 
ManageIQ - Sprint 264 Review - Slide Deck
ManageIQ
 
Iobit Driver Booster Pro 12 Crack Free Download
chaudhryakashoo065
 
Mistakes to Avoid When Selecting Policy Management Software
Insurance Tech Services
 
GridView,Recycler view, API, SQLITE& NetworkRequest.pdf
Nabin Dhakal
 
capitulando la keynote de GrafanaCON 2025 - Madrid
Imma Valls Bernaus
 
MiniTool Power Data Recovery Full Crack Latest 2025
muhammadgurbazkhan
 
>Nitro Pro Crack 14.36.1.0 + Keygen Free Download [Latest]
utfefguu
 
For my supp to finally picking supp that work
necas19388
 

Mix ‘n’ Match Async and Group Replication for Advanced Replication Setups

  • 1. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Mix ‘n’ Match Async and Group Replication for Advanced Replication Setups Pedro Gomes ([email protected]) Software Engineer 4th of February Oracle / Fosdem 2017 1
  • 2. Copyright © 2017, 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. 24th of February Oracle / Fosdem 2017
  • 3. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Program Agenda 4th of February Oracle / Fosdem 2017
  • 4. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Background Mix it! Migrations Conclusion Program Agenda 4th of February Oracle / Fosdem 2017 4 1 2 3 4
  • 5. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Background 4th of February Oracle / Fosdem 2017 1
  • 6. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | In the beggining there was Async Replication 64th of February Oracle / Fosdem 2017 S1 S2 S3 Master MySQL Connector Application MySQL Connector Application Writes Reads Async replication connection In the beginning there was asynchronous replication. You write in the master where events are logged and sent to the slaves where they are queued and applied. This can be used for data safety on master crashes or read scalability
  • 7. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Semi sync Replication 74th of February Oracle / Fosdem 2017 S1 S2 S3 Master MySQL Connector Application MySQL Connector Application ACK ACK On 5.5 we introduced semi sync. The idea is that when the master commits it waits for the slaves to queue the transaction or to prepare the commit. You can wait on all or on a set number of slaves.
  • 8. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Multi Source Replication 84th of February Oracle / Fosdem 2017 S1 S2 S3 Master MySQL Connector Application MySQL Connector Application Master MySQL Connector Application On early 5.7 we introduced Multi source. It introduced the notion of channel, i.e., a replication sources. Slaves can now have different channels that will receive data from different masters. Conflicts are not detected. This can be used for data aggregation or full backups of sharded data
  • 9. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Group Replication 94th of February Oracle / Fosdem 2017 Master MySQL Connector Application MySQL Connector Application Master MySQL Connector Application Master Group We now present Group replication. When you write in a member, the information flows to the other members in a ordered way, meaning all members get the same transactions in the same order. More on the next slide
  • 10. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL Group Replication • What is MySQL Group Replication? “Multi-master update everywhere 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 handling server fail-over. – Provides fault tolerance. – Enables update everywhere setups. – Automates group reconfiguration (handling of crashes, failures, re-connects). – Provides a highly available replicated database. 104th of February Oracle / Fosdem 2017
  • 11. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Mix it! 4th of February Oracle / Fosdem 2017 2 2.1 Basic scenarios
  • 12. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Read out Scalability 124th of February Oracle / Fosdem 2017 Master MySQL Connector Application MySQL Connector Application Master MySQL Connector Application Master S1 S2 S3 If you are afraid of the 9 members limitation and you want to scale your reads, you can add more slaves that replicate from the group. Remember that the group has automatic failover, but not your slaves.
  • 13. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Aggregate some data 134th of February Oracle / Fosdem 2017 Master MySQL Connector Applicaton Master Master S Master Master Master Multi source can also be used to aggregate data from 2 groups. Again you can do some data analyses or have a full backup of your data.
  • 14. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Mix it! 4th of February Oracle / Fosdem 2017 2 2.2 Advanced scenarios
  • 15. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Inter data center replication 154th of February Oracle / Fosdem 2017 Master Master Master Master Master Master If you have different groups on different databases you can still replication from one to another using asynchronous replication. Here we use 2 pairs of servers to share the load of this task among the members, but you can use only one circular pair or have even more connections if desired.
  • 16. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Migrations 4th of February Oracle / Fosdem 2017 3 How to migrate from asynchronous replication3.1
  • 17. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | How to migrate from asynchronous scenarios 174th of February Oracle / Fosdem 2017 Master Master Master Master S1 S2 ?
  • 18. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | How to migrate from asynchronous scenarios 184th of February Oracle / Fosdem 2017 M1 M2 S1 S2 MySQL Connector Application Here I chose to start the group in a new provisioned member but you can also start by doing this in on of the existing slaves . M2 will replicate from M1 using async replication.
  • 19. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | How to migrate from asynchronous scenarios 194th of February Oracle / Fosdem 2017 M1 M2 S1 S2 MySQL Connector Application On by one you can start moving the slaves into the group. As all info applied into M1 is disseminated to the group, you can starting migrating reads to it and the migrated slaves.
  • 20. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | How to migrate from asynchronous scenarios 204th of February Oracle / Fosdem 2017 M1 M2 S2 MySQL Connector Application S1 Eventually all slaves will be migrated to the group. Now comes the trick part.
  • 21. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | How to migrate from asynchronous scenarios 214th of February Oracle / Fosdem 2017 M1 M2 S2 MySQL Connector Application S1 If your workload allows it, start migrating some writes to the group gradually. If not, you need to wait for the delay from M1 to M2 to be nearly 0, block writes on M1 and then switch to M2 when that last N transactions from M1 are replicated.
  • 22. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | How to migrate from asynchronous scenarios 224th of February Oracle / Fosdem 2017 M1 M2 S2 MySQL Connector Application S1 Now you just need to add M1 to the group. Distributed recovery will make the member catch up to the writes it missed in the transition to the group.
  • 23. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Migrations 4th of February Oracle / Fosdem 2017 3 Different servers3.2
  • 24. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Migrate disjoint servers into Group replication 244th of February Oracle / Fosdem 2017 M1 MySQL Connector Application M2 MySQL Connector Application This one is a less common case, but still interesting as a migration example. What if you want to merge shards or two applications into a group to make it HA?
  • 25. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Migrate disjoint servers into Group replication 254th of February Oracle / Fosdem 2017 M1 MySQL Connector Application M2 MySQL Connector Application Start replicating from one of the servers into the other. One thing to consider here: the member that becomes a slave has to deal with this increased load, but on the other hand, we must eventually block writes to the M1 for a brief moment.
  • 26. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Migrate disjoint servers into Group replication 264th of February Oracle / Fosdem 2017 M1 MySQL Connector Application M2 MySQL Connector Application Start a group with M2
  • 27. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Migrate disjoint servers into Group replication 274th of February Oracle / Fosdem 2017 M1 MySQL Connector Application M2 MySQL Connector Application M3 We add a new member here for 2 reasons: 1. The resulting group with only two members, M1 and M2, could suffer from split brain problems if one of them died. 2. There is a moment where M1 will stop serving requests and at that moment M2 would take all the load alone.
  • 28. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Migrate disjoint servers into Group replication 284th of February Oracle / Fosdem 2017 M1 MySQL Connector Application M2 MySQL Connector Application M3 If your workload allows it, start migrating some M1 writes to the group gradually. If not, you need to wait for the delay from M1 to M2 to be nearly 0, block writes on M1 and then switch to M2 when that last N transactions are replicated.
  • 29. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Migrate disjoint servers into Group replication 294th of February Oracle / Fosdem 2017 M1 MySQL Connector Application M2 MySQL Connector Application M3 You can now join M1 to the group, being probably best to do some provisioning here
  • 30. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Migrate disjoint servers into Group replication (alternative) 304th of February Oracle / Fosdem 2017 M1 MySQL Connector Application M2 MySQL Connector Application S Another alternative is to add a multi source slave that will replicate from both members.
  • 31. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Migrate disjoint servers into Group replication (alternative) 314th of February Oracle / Fosdem 2017 M1 MySQL Connector Application M2 MySQL Connector Application S Start a new group on this slave.
  • 32. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Migrate disjoint servers into Group replication (alternative) 324th of February Oracle / Fosdem 2017 M1 MySQL Connector Application M2 MySQL Connector Application S If your workload allows it, start migrating some writes to S gradually. If not, you need to wait for the delay from M2 to S to be nearly 0, block writes on M2 and then switch to S. Add M2 to the group.
  • 33. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Migrate disjoint servers into Group replication (alternative) 334th of February Oracle / Fosdem 2017 M1 MySQL Connector Application M2 MySQL Connector Application S When M2 can take writes from its original application repeat the previous step with M1.
  • 34. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Migrations 4th of February Oracle / Fosdem 2017 3 Going Back3.3
  • 35. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | From Group Replication to Asynchronous topologies 354th of February Oracle / Fosdem 2017 M2 M1 MySQL Connector Application M3
  • 36. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | From Group Replication to Asynchronous topologies 364th of February Oracle / Fosdem 2017 M2 M1 MySQL Connector Application S3 Just stop group replication in one member and configure it as a slave of the one the original members. If using multi master direct all writes to this member that is now a master.
  • 37. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | From Group Replication to Asynchronous topologies 374th of February Oracle / Fosdem 2017 S2 M1 MySQL Connector Application S3 Repeat the same process for the other members until only the master remains in the group. At that point stop group replication on the master as well.
  • 38. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Conclusion 4th of February Oracle / Fosdem 2017 4 This presentation only contains examples of possible setups. Other possibilities may exist, just try it
  • 39. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Where to go from here? • GA Packages – http://www.mysql.com/downloads/ • Documentation – http://dev.mysql.com/doc/refman/5.7/en/group-replication.html • Blogs from the Engineers (news, technical information, and much more) – http://mysqlhighavailability.com 394th of February Oracle / Fosdem 2017
  • 41. Copyright © 2017, Oracle and/or its affiliates. All rights reserved.4th of February Oracle / Fosdem 2017 41 @distributedpete Twitter: Thanks!