SlideShare a Scribd company logo
1 of 62
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |Tuesday, September 22, 2015 Percona Live - Amsterdam
State of MySQL Group Replication
Nuno Carvalho (nuno.carvalho@oracle.com)
Principal Software Engineer, MySQL Replication Service Team Lead
1
Copyright © 2015, 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.
Tuesday, September 22, 2015 Percona Live - Amsterdam 2
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Program Agenda
Tuesday, September 22, 2015 Percona Live - Amsterdam
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Program Agenda
Background
MySQL Group Replication
Architecture
Use cases
Conclusion
1
2
3
4
5
Tuesday, September 22, 2015 Percona Live - Amsterdam 4
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Background1
Tuesday, September 22, 2015 Percona Live - Amsterdam
Copyright © 2015, 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?
Tuesday, September 22, 2015 Percona Live - Amsterdam 6
Copyright © 2015, 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?
Tuesday, September 22, 2015 Percona Live - Amsterdam 7
Copyright © 2015, 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.
Tuesday, September 22, 2015 Percona Live - Amsterdam 8
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
MySQL Group Replication
Tuesday, September 22, 2015 Percona Live - Amsterdam 9
M M M M M
Replication Group
Clients
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
• Strong development cycles and continuous community engagement
through regular lab releases.
MySQL Group Replication
Tuesday, September 22, 2015 Percona Live - Amsterdam 10
2014-Sep-29
Labs release: 0.2.0
2015-Apr-06
Labs release: 0.3.0
2014-Aug-06
Labs release: 0.4.0
2015-Sep-14
Labs release: 0.5.0
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
• Strong development cycles and continuous community engagement
through regular lab releases.
MySQL Group Replication
Tuesday, September 22, 2015 Percona Live - Amsterdam 11
2014-Sep-29
Labs release: 0.2.0
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 standalone plugin,
with its own release cycle!
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
MySQL Group Replication2
Tuesday, September 22, 2015
2.1
Percona Live - Amsterdam
Multi-Master
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Multi-Master update everywhere!
• Any two transactions on different servers can write to the same tuple.
• Conflicts will be detected and dealt with (first committer wins rule).
Tuesday, September 22, 2015 Percona Live - Amsterdam 13
M M M M M
UPDATE t1 SET a=2 WHERE a=1UPDATE t1 SET a=3 WHERE a=1
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Multi-Master update everywhere!
• Any two transactions on different servers can write to the same tuple.
• Conflicts will be detected and dealt with (first committer wins rule).
Tuesday, September 22, 2015 Percona Live - Amsterdam 14
M M M M M
UPDATE t1 SET a=2 WHERE a=1UPDATE t1 SET a=3 WHERE a=1
OK
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Multi-Master update everywhere!
• Any two transactions on different servers can write to the same tuple.
• Conflicts will be detected and dealt with (first committer wins rule).
Tuesday, September 22, 2015 Percona Live - Amsterdam 15
M M M M M
UPDATE t1 SET a=4 WHERE a=2UPDATE t1 SET a=3 WHERE a=1
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Multi-Master update everywhere!
• Any two transactions on different servers can write to the same tuple.
• Conflicts will be detected and dealt with (first committer wins rule).
Tuesday, September 22, 2015 Percona Live - Amsterdam 16
M M M M M
UPDATE t1 SET a=4 WHERE a=2UPDATE t1 SET a=3 WHERE a=1
OKOK
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
MySQL Group Replication2
Tuesday, September 22, 2015
2.1
2.2
Percona Live - Amsterdam
Multi-Master
Automatic distributed server recovery
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Automatic distributed server recovery!
• Server that joins the group will automatically synchronize with the others.
Tuesday, September 22, 2015 Percona Live - Amsterdam 18
M M M M M N
I want to play with you
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Automatic distributed server recovery!
• Server that joins the group will automatically synchronize with the others.
Tuesday, September 22, 2015 Percona Live - Amsterdam 19
M M M M M N
ONLINE
RECOVERING
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Automatic distributed server recovery!
• Server that joins the group will automatically synchronize with the others.
Tuesday, September 22, 2015 Percona Live - Amsterdam 20
M M M M M N
ONLINE
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Automatic distributed server recovery!
• If a server leaves the group, the others will automatically be informed.
Tuesday, September 22, 2015 Percona Live - Amsterdam 21
M M M M M N
My machine needs maintenance
or a system crash happens
Each membership configuration
is identified by a view_id
view_id: 4
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Automatic distributed server recovery!
• If a server leaves the group, the others will automatically be informed.
Tuesday, September 22, 2015 Percona Live - Amsterdam 22
M M M M N
view_id: 5
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Automatic distributed server recovery!
• Server that (re)joins the group will automatically synchronize with the
others.
Tuesday, September 22, 2015 Percona Live - Amsterdam 23
M M M M M N
RECOVERING -> ONLINE
view_id: 6
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
MySQL Group Replication2
Tuesday, September 22, 2015
2.1
2.2
2.3
Percona Live - Amsterdam
Multi-Master
Automatic distributed server recovery
MySQL/InnoDB look & feel
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
MySQL/InnoDB look & feel!
• Load the plugin and start replicating.
• Monitor group replication stats though Performance Schema tables.
Tuesday, September 22, 2015 Percona Live - Amsterdam 25
mysql> SET GLOBAL group_replication_group_name= "9eb07c6d-5e24-11e5-854b-34028662c0cd";
mysql> START GROUP_REPLICATION;
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 © 2015, Oracle and/or its affiliates. All rights reserved. |
MySQL/InnoDB look & feel!
• Load the plugin and start replicating.
• Monitor group replication stats though Performance Schema tables.
Tuesday, September 22, 2015 Percona Live - Amsterdam 26
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
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
MySQL/InnoDB look & feel!
• Load the plugin and start replicating.
• Monitor group replication stats though Performance Schema tables.
Tuesday, September 22, 2015 Percona Live - Amsterdam 27
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
...
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
MySQL Group Replication2
Tuesday, September 22, 2015
2.1
2.2
2.3
2.4
Percona Live - Amsterdam
Multi-Master
Automatic distributed server recovery
MySQL/InnoDB look & feel
Full GTID support
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Full GTID support!
• All group members share the same UUID, the group name.
Tuesday, September 22, 2015 Percona Live - Amsterdam 29
M M M M M
INSERT y;
Will have GTID: group_name:2
INSERT x;
Will have GTID: group_name:1
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Full GTID support!
• Users can specify the identifier for the transaction.
Tuesday, September 22, 2015 Percona Live - Amsterdam 30
M M M M M
INSERT y;
Will have GTID: group_name:1
SET GTID_NEXT= “UUID:50”
INSERT x;
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Full GTID support!
• You can even replicate from a outside server to a group, global identifiers
will be preserved.
Tuesday, September 22, 2015 Percona Live - Amsterdam 31
M M M M M
Conflicts will be detected!
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
MySQL Group Replication2
Tuesday, September 22, 2015
2.1
2.2
2.3
2.4
2.5
Percona Live - Amsterdam
Multi-Master
Automatic distributed server recovery
MySQL/InnoDB look & feel
Auto-increment configuration/handling
Full GTID support
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Auto-increment configuration/handling
• Group is configured not to generate the same auto-increment value on all
members.
Tuesday, September 22, 2015 Percona Live - Amsterdam 33
M M M M M
INSERT y;
y: 4
INSERT z;
z: 11
INSERT x;
x: 1
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Auto-increment configuration/handling
• By default, the offset is provided by server_id and increment is 7 [1].
Tuesday, September 22, 2015 Percona Live - Amsterdam 34
M M M M M
INSERT y;
y: 4
INSERT z;
z: 11
INSERT x;
x: 1
[1]: http://mysqlhighavailability.com/mysql-group-replication-auto-increment-configuration-handling/
server_id: 1
server_id: 4
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Auto-increment configuration/handling
• Users can change the increment size to their needs using
GROUP_REPLICATION_AUTO_INCREMENT_INCREMENT option.
Tuesday, September 22, 2015 Percona Live - Amsterdam 35
M M M M M
INSERT y;
y: 4
INSERT z;
z: 11
INSERT x;
x: 1
server_id: 1
server_id: 4
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Plugin version access control
MySQL Group Replication2
Tuesday, September 22, 2015
2.1
2.2
2.3
2.4
2.5
Percona Live - Amsterdam
2.6
Multi-Master
Automatic distributed server recovery
MySQL/InnoDB look & feel
Auto-increment configuration/handling
Full GTID support
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Plugin Version Access Control
• When joining, versions are crucial when determining if a member is
compatible with a group.
Tuesday, September 22, 2015 Percona Live - Amsterdam 37
0.4.1 0.4.2 0.4.2 0.4.3 0.4.0
Member with lower patch
version is allowed to join
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Plugin Version Access Control
• When joining, versions are crucial when determining if a member is
compatible with a group.
Tuesday, September 22, 2015 Percona Live - Amsterdam 38
0.4.0 0.4.2 0.5.0 0.5.1 0.4.0
Member with lower minor version
than the maximum minor version in
the group is not allowed to join
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Plugin Version Access Control
• When joining, versions are crucial when determining if a member is
compatible with a group.
Tuesday, September 22, 2015 Percona Live - Amsterdam 39
0.4.0 0.4.0 0.4.1 0.4.2 0.5.0
Member with higher minor
version is allowed to join
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Requirements
Plugin version access control
MySQL Group Replication2
Tuesday, September 22, 2015
2.1
2.2
2.3
2.4
2.5
Percona Live - Amsterdam
2.6
2.7
Multi-Master
Automatic distributed server recovery
MySQL/InnoDB look & feel
Auto-increment configuration/handling
Full GTID support
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Requirements (by design)
• Only supports InnoDB.
• Primary key is required on every table.
• Requires global transaction identifiers turned on.
• Optimistic execution: transactions may abort on COMMIT due to conflicts
with concurrent transactions on other members.
Tuesday, September 22, 2015 Percona Live - Amsterdam 41
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Requirements
Plugin version access control
MySQL Group Replication2
Tuesday, September 22, 2015
2.1
2.2
2.3
2.4
2.5
Percona Live - Amsterdam
2.6
2.7
Multi-Master
Automatic distributed server recovery
MySQL/InnoDB look & feel
Auto-increment configuration/handling
2.8
Full GTID support
Limitations
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Limitations
• Concurrent DDL is not supported.
• Limited transaction payload size.
Tuesday, September 22, 2015 Percona Live - Amsterdam 43
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Architecture
Introduction
3
Tuesday, September 22, 2015
3.1
Percona Live - Amsterdam
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
MySQL Group Replication is
• Built on top of proven technology!
– Shares many of MySQL Replication.
– Multi-Master approach to replication.
• Built on reusable components!
– Layered implementation approach.
– Interface driven development.
– Decoupled from the server core.
– The plugin registers as listener to server events.
– Reuses the capture procedure from regular replication.
– Provides further decoupling from the communication infrasctructure.
Tuesday, September 22, 2015 Percona Live - Amsterdam 45
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Major Building Blocks
Architecture
Introduction
3
Tuesday, September 22, 2015
3.1
3.2
Percona Live - Amsterdam
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Major Building Blocks (1)
Tuesday, September 22, 2015 Percona Live - Amsterdam 47
M M M M M
Com. API
Replication
Plugin
API
MySQL
Server
Group Comm.
System (Corosync)
Group Comm.
System (Corosync)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Major Building Blocks (2)
• Server calls into the plugin through a generic
interface
– (Most of server) internals are hidden from the plugin.
– Some of the semi-sync interfaces were reused. Others
were deployed.
• Plugin interacts with the server through a generic
interface
– Replication plugin determines the fate of the commit
operation through a well defined server interface.
– The plugin makes use of the relay log infrastructure to
inject changes in the receiving server.
Tuesday, September 22, 2015 Percona Live - Amsterdam 48
Com. API
Replication
Plugin
API
MySQL
Server
Group Comm.
System (Corosync)
Group Comm.
System (Corosync)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Major Building Blocks (3)
• The plugin is responsible for
– Maintaining distributed execution context.
– Detecting conflicts.
– Handling distributed recovery:
• Detect membership changes;
• Donate state if needed;
• Collect state if needed.
– Receiving and handling transactions from other
members.
– Deciding the fate of on-going transactions.
Tuesday, September 22, 2015 Percona Live - Amsterdam 49
Com. API
Replication
Plugin
API
MySQL
Server
Group Comm.
System (Corosync)
Group Comm.
System (Corosync)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Major Building Blocks (4)
• The communication API (and bindings) is
responsible for:
– Abstracting the underlaying communication system
from the plugin itself.
– Maping the interface to a specific communication
toolkit:
• Currently, MySQL Group Replication uses Corosync as the
underlying group communication system.
Tuesday, September 22, 2015 Percona Live - Amsterdam 50
Com. API
Replication
Plugin
API
MySQL
Server
Group Comm.
System (Corosync)
Group Comm.
System (Corosync)
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
The Complete Stack
Major Building Blocks
Architecture
Introduction
3
Tuesday, September 22, 2015
3.1
3.2
3.3
Percona Live - Amsterdam
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
The Complete Stack
Tuesday, September 22, 2015 Percona Live - Amsterdam 52
API
Replication
Plugin
API
MySQL
Server
Performance Schema Tables: Monitoring
MySQL
APIs: Lifecycle / Capture / Applier
InnoDB
Replication Protocol
Group Comm. API
Corosync
Network
Plugin
Capture Applier
Conflicts
Handler
Group Comm.
System (Corosync)
Group Comm.
System (Corosync)
Group Comm. Binding
Recovery
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Use cases
Use cases
4
Tuesday, September 22, 2015
4.1
Percona Live - Amsterdam
Copyright © 2015, 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 pain 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 into a
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.
Tuesday, September 22, 2015 Percona Live - Amsterdam 54
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
MySQL Router
Use cases
Use cases
4
Tuesday, September 22, 2015
4.1
4.2
Percona Live - Amsterdam
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
MySQL Router
• Motivation
– The need for transparent integration with Fabric.
• No need to upgrade existing connectors.
• Use Fabric with connectors that do not support it (e.g.,
Ruby, Perl, C).
– The need for read-write and read-only automatic
routing.
• Do not need to know which server is the master.
• Transparent fail-over support for a new master.
• End Result
– Generic and versatile framework: MySQL Router.
Tuesday, September 22, 2015 Percona Live - Amsterdam
NEW
M
Router
App
M M
Fabric
56
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
MySQL Router
• Highlights
– High Performance
– Plugin Driven Architecture
– Simple to setup, configure and deploy.
• Features
– Simple Load balancing
– Seamless fail-over based on Fabric HA Groups
– Basic support for minimizing transaction conflicts
when deployed together with multi-master mode
on Group Replication.
Tuesday, September 22, 2015 Percona Live - Amsterdam
M
Router
App
M M
Fabric
NEW
57
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Server/Shard State &
Mapping
MySQL Scaling (HA + Sharding)
MySQL Fabric
Controller
HA Group
Coordination
and Control
58
MySQL
Router
Tuesday, September 22, 2015 Percona Live - Amsterdam
M M M
Shard 1
HA Group
M M M
Shard 2
HA Group
M M M
Shard N
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Conclusion5
Tuesday, September 22, 2015 Percona Live - Amsterdam
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
Summary
• Cloud Friendly
– Great techonology for deployments where elasticity is a requirement, such as cloud
based infrastructures.
• Integrated
– With server core through a well defined API.
– With GTIDs, row based replication, 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 everywhere and a dependable
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.
Tuesday, September 22, 2015 Percona Live - Amsterdam 60
Copyright © 2015, 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
Tuesday, September 22, 2015 Percona Live - Amsterdam 61
State of MySQL Group Replication - Percona Live Europe 2015

More Related Content

Viewers also liked

Treasure Data and AWS - Developers.io 2015
Treasure Data and AWS - Developers.io 2015Treasure Data and AWS - Developers.io 2015
Treasure Data and AWS - Developers.io 2015N Masahiro
 
MySQL High Availability with Replication New Features
MySQL High Availability with Replication New FeaturesMySQL High Availability with Replication New Features
MySQL High Availability with Replication New FeaturesShivji Kumar Jha
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group ReplicationBogdan Kecman
 
FOSSASIA 2015: MySQL Group Replication
FOSSASIA 2015: MySQL Group ReplicationFOSSASIA 2015: MySQL Group Replication
FOSSASIA 2015: MySQL Group ReplicationShivji Kumar Jha
 
Advanced mysql replication techniques
Advanced mysql replication techniquesAdvanced mysql replication techniques
Advanced mysql replication techniquesGiuseppe Maxia
 
High-Availability using MySQL Fabric
High-Availability using MySQL FabricHigh-Availability using MySQL Fabric
High-Availability using MySQL FabricMats Kindahl
 
MySQL InnoDB Cluster 미리보기 (remote cluster test)
MySQL InnoDB Cluster 미리보기 (remote cluster test)MySQL InnoDB Cluster 미리보기 (remote cluster test)
MySQL InnoDB Cluster 미리보기 (remote cluster test)Seungmin Yu
 
Haute disponibilité my sql avec group réplication
Haute disponibilité my sql avec group réplicationHaute disponibilité my sql avec group réplication
Haute disponibilité my sql avec group réplicationFrederic Descamps
 
MySQL High Availability with Group Replication
MySQL High Availability with Group ReplicationMySQL High Availability with Group Replication
MySQL High Availability with Group ReplicationNuno Carvalho
 
Group Replication: A Journey to the Group Communication Core
Group Replication: A Journey to the Group Communication CoreGroup Replication: A Journey to the Group Communication Core
Group Replication: A Journey to the Group Communication CoreAlfranio Júnior
 
MySQL 5.7 Fabric: Introduction to High Availability and Sharding
MySQL 5.7 Fabric: Introduction to High Availability and Sharding MySQL 5.7 Fabric: Introduction to High Availability and Sharding
MySQL 5.7 Fabric: Introduction to High Availability and Sharding Ulf Wendel
 
MySQL Replication Evolution -- Confoo Montreal 2017
MySQL Replication Evolution -- Confoo Montreal 2017MySQL Replication Evolution -- Confoo Montreal 2017
MySQL Replication Evolution -- Confoo Montreal 2017Dave Stokes
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group ReplicationUlf Wendel
 
MySQL High Availability -- InnoDB Clusters
MySQL High Availability -- InnoDB ClustersMySQL High Availability -- InnoDB Clusters
MySQL High Availability -- InnoDB ClustersMatt Lord
 
MySQL High Availability Solutions - Feb 2015 webinar
MySQL High Availability Solutions - Feb 2015 webinarMySQL High Availability Solutions - Feb 2015 webinar
MySQL High Availability Solutions - Feb 2015 webinarAndrew Morgan
 
Multi Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ VerisureMulti Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ VerisureKenny Gryp
 

Viewers also liked (17)

Treasure Data and AWS - Developers.io 2015
Treasure Data and AWS - Developers.io 2015Treasure Data and AWS - Developers.io 2015
Treasure Data and AWS - Developers.io 2015
 
MySQL High Availability with Replication New Features
MySQL High Availability with Replication New FeaturesMySQL High Availability with Replication New Features
MySQL High Availability with Replication New Features
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 
FOSSASIA 2015: MySQL Group Replication
FOSSASIA 2015: MySQL Group ReplicationFOSSASIA 2015: MySQL Group Replication
FOSSASIA 2015: MySQL Group Replication
 
Advanced mysql replication techniques
Advanced mysql replication techniquesAdvanced mysql replication techniques
Advanced mysql replication techniques
 
High-Availability using MySQL Fabric
High-Availability using MySQL FabricHigh-Availability using MySQL Fabric
High-Availability using MySQL Fabric
 
MySQL InnoDB Cluster 미리보기 (remote cluster test)
MySQL InnoDB Cluster 미리보기 (remote cluster test)MySQL InnoDB Cluster 미리보기 (remote cluster test)
MySQL InnoDB Cluster 미리보기 (remote cluster test)
 
Haute disponibilité my sql avec group réplication
Haute disponibilité my sql avec group réplicationHaute disponibilité my sql avec group réplication
Haute disponibilité my sql avec group réplication
 
MySQL High Availability with Group Replication
MySQL High Availability with Group ReplicationMySQL High Availability with Group Replication
MySQL High Availability with Group Replication
 
Group Replication: A Journey to the Group Communication Core
Group Replication: A Journey to the Group Communication CoreGroup Replication: A Journey to the Group Communication Core
Group Replication: A Journey to the Group Communication Core
 
MySQL 5.7 Fabric: Introduction to High Availability and Sharding
MySQL 5.7 Fabric: Introduction to High Availability and Sharding MySQL 5.7 Fabric: Introduction to High Availability and Sharding
MySQL 5.7 Fabric: Introduction to High Availability and Sharding
 
MySQL Replication Evolution -- Confoo Montreal 2017
MySQL Replication Evolution -- Confoo Montreal 2017MySQL Replication Evolution -- Confoo Montreal 2017
MySQL Replication Evolution -- Confoo Montreal 2017
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 
MySQL High Availability -- InnoDB Clusters
MySQL High Availability -- InnoDB ClustersMySQL High Availability -- InnoDB Clusters
MySQL High Availability -- InnoDB Clusters
 
MySQL Cluster Basics
MySQL Cluster BasicsMySQL Cluster Basics
MySQL Cluster Basics
 
MySQL High Availability Solutions - Feb 2015 webinar
MySQL High Availability Solutions - Feb 2015 webinarMySQL High Availability Solutions - Feb 2015 webinar
MySQL High Availability Solutions - Feb 2015 webinar
 
Multi Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ VerisureMulti Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ Verisure
 

Recently uploaded

Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesSoftwareMill
 
Why Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfWhy Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfBrain Inventory
 
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdfARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdfTobias Schneck
 
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine HarmonyLeveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmonyelliciumsolutionspun
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntelliSource Technologies
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeNeo4j
 
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...OnePlan Solutions
 
Streamlining Your Application Builds with Cloud Native Buildpacks
Streamlining Your Application Builds  with Cloud Native BuildpacksStreamlining Your Application Builds  with Cloud Native Buildpacks
Streamlining Your Application Builds with Cloud Native BuildpacksVish Abrams
 
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.Sharon Liu
 
AI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyAI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyRaymond Okyere-Forson
 
Fields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxFields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxJoão Esperancinha
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadIvo Andreev
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Incrobinwilliams8624
 
Sales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales CoverageSales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales CoverageDista
 
Top Software Development Trends in 2024
Top Software Development Trends in  2024Top Software Development Trends in  2024
Top Software Development Trends in 2024Mind IT Systems
 
JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIIvo Andreev
 
Kawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies
 
ERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxAutus Cyber Tech
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Jaydeep Chhasatia
 
How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?AmeliaSmith90
 

Recently uploaded (20)

Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retries
 
Why Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfWhy Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdf
 
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdfARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
 
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine HarmonyLeveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptx
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG time
 
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
 
Streamlining Your Application Builds with Cloud Native Buildpacks
Streamlining Your Application Builds  with Cloud Native BuildpacksStreamlining Your Application Builds  with Cloud Native Buildpacks
Streamlining Your Application Builds with Cloud Native Buildpacks
 
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.
 
AI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyAI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human Beauty
 
Fields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxFields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptx
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and Bad
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Inc
 
Sales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales CoverageSales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales Coverage
 
Top Software Development Trends in 2024
Top Software Development Trends in  2024Top Software Development Trends in  2024
Top Software Development Trends in 2024
 
JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AI
 
Kawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in Trivandrum
 
ERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptx
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
 
How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?
 

State of MySQL Group Replication - Percona Live Europe 2015

  • 1. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |Tuesday, September 22, 2015 Percona Live - Amsterdam State of MySQL Group Replication Nuno Carvalho (nuno.carvalho@oracle.com) Principal Software Engineer, MySQL Replication Service Team Lead 1
  • 2. Copyright © 2015, 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. Tuesday, September 22, 2015 Percona Live - Amsterdam 2
  • 3. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Program Agenda Tuesday, September 22, 2015 Percona Live - Amsterdam
  • 4. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Program Agenda Background MySQL Group Replication Architecture Use cases Conclusion 1 2 3 4 5 Tuesday, September 22, 2015 Percona Live - Amsterdam 4
  • 5. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Background1 Tuesday, September 22, 2015 Percona Live - Amsterdam
  • 6. Copyright © 2015, 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? Tuesday, September 22, 2015 Percona Live - Amsterdam 6
  • 7. Copyright © 2015, 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? Tuesday, September 22, 2015 Percona Live - Amsterdam 7
  • 8. Copyright © 2015, 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. Tuesday, September 22, 2015 Percona Live - Amsterdam 8
  • 9. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL Group Replication Tuesday, September 22, 2015 Percona Live - Amsterdam 9 M M M M M Replication Group Clients
  • 10. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | • Strong development cycles and continuous community engagement through regular lab releases. MySQL Group Replication Tuesday, September 22, 2015 Percona Live - Amsterdam 10 2014-Sep-29 Labs release: 0.2.0 2015-Apr-06 Labs release: 0.3.0 2014-Aug-06 Labs release: 0.4.0 2015-Sep-14 Labs release: 0.5.0
  • 11. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | • Strong development cycles and continuous community engagement through regular lab releases. MySQL Group Replication Tuesday, September 22, 2015 Percona Live - Amsterdam 11 2014-Sep-29 Labs release: 0.2.0 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 standalone plugin, with its own release cycle!
  • 12. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL Group Replication2 Tuesday, September 22, 2015 2.1 Percona Live - Amsterdam Multi-Master
  • 13. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Multi-Master update everywhere! • Any two transactions on different servers can write to the same tuple. • Conflicts will be detected and dealt with (first committer wins rule). Tuesday, September 22, 2015 Percona Live - Amsterdam 13 M M M M M UPDATE t1 SET a=2 WHERE a=1UPDATE t1 SET a=3 WHERE a=1
  • 14. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Multi-Master update everywhere! • Any two transactions on different servers can write to the same tuple. • Conflicts will be detected and dealt with (first committer wins rule). Tuesday, September 22, 2015 Percona Live - Amsterdam 14 M M M M M UPDATE t1 SET a=2 WHERE a=1UPDATE t1 SET a=3 WHERE a=1 OK
  • 15. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Multi-Master update everywhere! • Any two transactions on different servers can write to the same tuple. • Conflicts will be detected and dealt with (first committer wins rule). Tuesday, September 22, 2015 Percona Live - Amsterdam 15 M M M M M UPDATE t1 SET a=4 WHERE a=2UPDATE t1 SET a=3 WHERE a=1
  • 16. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Multi-Master update everywhere! • Any two transactions on different servers can write to the same tuple. • Conflicts will be detected and dealt with (first committer wins rule). Tuesday, September 22, 2015 Percona Live - Amsterdam 16 M M M M M UPDATE t1 SET a=4 WHERE a=2UPDATE t1 SET a=3 WHERE a=1 OKOK
  • 17. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL Group Replication2 Tuesday, September 22, 2015 2.1 2.2 Percona Live - Amsterdam Multi-Master Automatic distributed server recovery
  • 18. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Automatic distributed server recovery! • Server that joins the group will automatically synchronize with the others. Tuesday, September 22, 2015 Percona Live - Amsterdam 18 M M M M M N I want to play with you
  • 19. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Automatic distributed server recovery! • Server that joins the group will automatically synchronize with the others. Tuesday, September 22, 2015 Percona Live - Amsterdam 19 M M M M M N ONLINE RECOVERING
  • 20. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Automatic distributed server recovery! • Server that joins the group will automatically synchronize with the others. Tuesday, September 22, 2015 Percona Live - Amsterdam 20 M M M M M N ONLINE
  • 21. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Automatic distributed server recovery! • If a server leaves the group, the others will automatically be informed. Tuesday, September 22, 2015 Percona Live - Amsterdam 21 M M M M M N My machine needs maintenance or a system crash happens Each membership configuration is identified by a view_id view_id: 4
  • 22. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Automatic distributed server recovery! • If a server leaves the group, the others will automatically be informed. Tuesday, September 22, 2015 Percona Live - Amsterdam 22 M M M M N view_id: 5
  • 23. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Automatic distributed server recovery! • Server that (re)joins the group will automatically synchronize with the others. Tuesday, September 22, 2015 Percona Live - Amsterdam 23 M M M M M N RECOVERING -> ONLINE view_id: 6
  • 24. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL Group Replication2 Tuesday, September 22, 2015 2.1 2.2 2.3 Percona Live - Amsterdam Multi-Master Automatic distributed server recovery MySQL/InnoDB look & feel
  • 25. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL/InnoDB look & feel! • Load the plugin and start replicating. • Monitor group replication stats though Performance Schema tables. Tuesday, September 22, 2015 Percona Live - Amsterdam 25 mysql> SET GLOBAL group_replication_group_name= "9eb07c6d-5e24-11e5-854b-34028662c0cd"; mysql> START GROUP_REPLICATION; 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 *************************** ...
  • 26. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL/InnoDB look & feel! • Load the plugin and start replicating. • Monitor group replication stats though Performance Schema tables. Tuesday, September 22, 2015 Percona Live - Amsterdam 26 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
  • 27. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL/InnoDB look & feel! • Load the plugin and start replicating. • Monitor group replication stats though Performance Schema tables. Tuesday, September 22, 2015 Percona Live - Amsterdam 27 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 ...
  • 28. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL Group Replication2 Tuesday, September 22, 2015 2.1 2.2 2.3 2.4 Percona Live - Amsterdam Multi-Master Automatic distributed server recovery MySQL/InnoDB look & feel Full GTID support
  • 29. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Full GTID support! • All group members share the same UUID, the group name. Tuesday, September 22, 2015 Percona Live - Amsterdam 29 M M M M M INSERT y; Will have GTID: group_name:2 INSERT x; Will have GTID: group_name:1
  • 30. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Full GTID support! • Users can specify the identifier for the transaction. Tuesday, September 22, 2015 Percona Live - Amsterdam 30 M M M M M INSERT y; Will have GTID: group_name:1 SET GTID_NEXT= “UUID:50” INSERT x;
  • 31. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Full GTID support! • You can even replicate from a outside server to a group, global identifiers will be preserved. Tuesday, September 22, 2015 Percona Live - Amsterdam 31 M M M M M Conflicts will be detected!
  • 32. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL Group Replication2 Tuesday, September 22, 2015 2.1 2.2 2.3 2.4 2.5 Percona Live - Amsterdam Multi-Master Automatic distributed server recovery MySQL/InnoDB look & feel Auto-increment configuration/handling Full GTID support
  • 33. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Auto-increment configuration/handling • Group is configured not to generate the same auto-increment value on all members. Tuesday, September 22, 2015 Percona Live - Amsterdam 33 M M M M M INSERT y; y: 4 INSERT z; z: 11 INSERT x; x: 1
  • 34. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Auto-increment configuration/handling • By default, the offset is provided by server_id and increment is 7 [1]. Tuesday, September 22, 2015 Percona Live - Amsterdam 34 M M M M M INSERT y; y: 4 INSERT z; z: 11 INSERT x; x: 1 [1]: http://mysqlhighavailability.com/mysql-group-replication-auto-increment-configuration-handling/ server_id: 1 server_id: 4
  • 35. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Auto-increment configuration/handling • Users can change the increment size to their needs using GROUP_REPLICATION_AUTO_INCREMENT_INCREMENT option. Tuesday, September 22, 2015 Percona Live - Amsterdam 35 M M M M M INSERT y; y: 4 INSERT z; z: 11 INSERT x; x: 1 server_id: 1 server_id: 4
  • 36. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Plugin version access control MySQL Group Replication2 Tuesday, September 22, 2015 2.1 2.2 2.3 2.4 2.5 Percona Live - Amsterdam 2.6 Multi-Master Automatic distributed server recovery MySQL/InnoDB look & feel Auto-increment configuration/handling Full GTID support
  • 37. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Plugin Version Access Control • When joining, versions are crucial when determining if a member is compatible with a group. Tuesday, September 22, 2015 Percona Live - Amsterdam 37 0.4.1 0.4.2 0.4.2 0.4.3 0.4.0 Member with lower patch version is allowed to join
  • 38. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Plugin Version Access Control • When joining, versions are crucial when determining if a member is compatible with a group. Tuesday, September 22, 2015 Percona Live - Amsterdam 38 0.4.0 0.4.2 0.5.0 0.5.1 0.4.0 Member with lower minor version than the maximum minor version in the group is not allowed to join
  • 39. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Plugin Version Access Control • When joining, versions are crucial when determining if a member is compatible with a group. Tuesday, September 22, 2015 Percona Live - Amsterdam 39 0.4.0 0.4.0 0.4.1 0.4.2 0.5.0 Member with higher minor version is allowed to join
  • 40. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Requirements Plugin version access control MySQL Group Replication2 Tuesday, September 22, 2015 2.1 2.2 2.3 2.4 2.5 Percona Live - Amsterdam 2.6 2.7 Multi-Master Automatic distributed server recovery MySQL/InnoDB look & feel Auto-increment configuration/handling Full GTID support
  • 41. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Requirements (by design) • Only supports InnoDB. • Primary key is required on every table. • Requires global transaction identifiers turned on. • Optimistic execution: transactions may abort on COMMIT due to conflicts with concurrent transactions on other members. Tuesday, September 22, 2015 Percona Live - Amsterdam 41
  • 42. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Requirements Plugin version access control MySQL Group Replication2 Tuesday, September 22, 2015 2.1 2.2 2.3 2.4 2.5 Percona Live - Amsterdam 2.6 2.7 Multi-Master Automatic distributed server recovery MySQL/InnoDB look & feel Auto-increment configuration/handling 2.8 Full GTID support Limitations
  • 43. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Limitations • Concurrent DDL is not supported. • Limited transaction payload size. Tuesday, September 22, 2015 Percona Live - Amsterdam 43
  • 44. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Architecture Introduction 3 Tuesday, September 22, 2015 3.1 Percona Live - Amsterdam
  • 45. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL Group Replication is • Built on top of proven technology! – Shares many of MySQL Replication. – Multi-Master approach to replication. • Built on reusable components! – Layered implementation approach. – Interface driven development. – Decoupled from the server core. – The plugin registers as listener to server events. – Reuses the capture procedure from regular replication. – Provides further decoupling from the communication infrasctructure. Tuesday, September 22, 2015 Percona Live - Amsterdam 45
  • 46. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Major Building Blocks Architecture Introduction 3 Tuesday, September 22, 2015 3.1 3.2 Percona Live - Amsterdam
  • 47. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Major Building Blocks (1) Tuesday, September 22, 2015 Percona Live - Amsterdam 47 M M M M M Com. API Replication Plugin API MySQL Server Group Comm. System (Corosync) Group Comm. System (Corosync)
  • 48. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Major Building Blocks (2) • Server calls into the plugin through a generic interface – (Most of server) internals are hidden from the plugin. – Some of the semi-sync interfaces were reused. Others were deployed. • Plugin interacts with the server through a generic interface – Replication plugin determines the fate of the commit operation through a well defined server interface. – The plugin makes use of the relay log infrastructure to inject changes in the receiving server. Tuesday, September 22, 2015 Percona Live - Amsterdam 48 Com. API Replication Plugin API MySQL Server Group Comm. System (Corosync) Group Comm. System (Corosync)
  • 49. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Major Building Blocks (3) • The plugin is responsible for – Maintaining distributed execution context. – Detecting conflicts. – Handling distributed recovery: • Detect membership changes; • Donate state if needed; • Collect state if needed. – Receiving and handling transactions from other members. – Deciding the fate of on-going transactions. Tuesday, September 22, 2015 Percona Live - Amsterdam 49 Com. API Replication Plugin API MySQL Server Group Comm. System (Corosync) Group Comm. System (Corosync)
  • 50. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Major Building Blocks (4) • The communication API (and bindings) is responsible for: – Abstracting the underlaying communication system from the plugin itself. – Maping the interface to a specific communication toolkit: • Currently, MySQL Group Replication uses Corosync as the underlying group communication system. Tuesday, September 22, 2015 Percona Live - Amsterdam 50 Com. API Replication Plugin API MySQL Server Group Comm. System (Corosync) Group Comm. System (Corosync)
  • 51. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | The Complete Stack Major Building Blocks Architecture Introduction 3 Tuesday, September 22, 2015 3.1 3.2 3.3 Percona Live - Amsterdam
  • 52. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | The Complete Stack Tuesday, September 22, 2015 Percona Live - Amsterdam 52 API Replication Plugin API MySQL Server Performance Schema Tables: Monitoring MySQL APIs: Lifecycle / Capture / Applier InnoDB Replication Protocol Group Comm. API Corosync Network Plugin Capture Applier Conflicts Handler Group Comm. System (Corosync) Group Comm. System (Corosync) Group Comm. Binding Recovery
  • 53. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Use cases Use cases 4 Tuesday, September 22, 2015 4.1 Percona Live - Amsterdam
  • 54. Copyright © 2015, 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 pain 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 into a 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. Tuesday, September 22, 2015 Percona Live - Amsterdam 54
  • 55. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL Router Use cases Use cases 4 Tuesday, September 22, 2015 4.1 4.2 Percona Live - Amsterdam
  • 56. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL Router • Motivation – The need for transparent integration with Fabric. • No need to upgrade existing connectors. • Use Fabric with connectors that do not support it (e.g., Ruby, Perl, C). – The need for read-write and read-only automatic routing. • Do not need to know which server is the master. • Transparent fail-over support for a new master. • End Result – Generic and versatile framework: MySQL Router. Tuesday, September 22, 2015 Percona Live - Amsterdam NEW M Router App M M Fabric 56
  • 57. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL Router • Highlights – High Performance – Plugin Driven Architecture – Simple to setup, configure and deploy. • Features – Simple Load balancing – Seamless fail-over based on Fabric HA Groups – Basic support for minimizing transaction conflicts when deployed together with multi-master mode on Group Replication. Tuesday, September 22, 2015 Percona Live - Amsterdam M Router App M M Fabric NEW 57
  • 58. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Server/Shard State & Mapping MySQL Scaling (HA + Sharding) MySQL Fabric Controller HA Group Coordination and Control 58 MySQL Router Tuesday, September 22, 2015 Percona Live - Amsterdam M M M Shard 1 HA Group M M M Shard 2 HA Group M M M Shard N
  • 59. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Conclusion5 Tuesday, September 22, 2015 Percona Live - Amsterdam
  • 60. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Summary • Cloud Friendly – Great techonology for deployments where elasticity is a requirement, such as cloud based infrastructures. • Integrated – With server core through a well defined API. – With GTIDs, row based replication, 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 everywhere and a dependable 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. Tuesday, September 22, 2015 Percona Live - Amsterdam 60
  • 61. Copyright © 2015, 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 Tuesday, September 22, 2015 Percona Live - Amsterdam 61