SlideShare a Scribd company logo
1 of 139
Download to read offline
1 / 139
2 / 139
MySQL InnoDB Cluster
When MySQL High Availability is Made Easy
 
The Boston MySQL Meetup Group - May 2017
3 / 139
 
Safe Harbor Statement
The following is intended to outline our generalproduct direction. It isintended for
information purpose only, and may not be incorporated into any contract. It isnot a
commitment to deliver any material, code, or functionality, and should not be relied up in
making purchasing decisions. Thedevelopment, release and timing of any features or
functionality described for Oracle´s product remains at thesole discretion of Oracle.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
4 / 139
about.me/lefred
Who am I ?
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
5 / 139
Frédéric Descamps
@lefred
MySQLEvangelist
HackingMySQLsince 3.23
devops believer
MySQLCommunity Manager since May
2016 (🎂)
living in Belgium 🇧🇪
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
6 / 139
MySQL InnoDB Cluster
Easy MySQL High Availability
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
7 / 139
InnoDB
cluster
Ease-of-Use
ExtremeScale-Out
Out-of-BoxSolution
Built-inHA
HighP erformance
EverythingIntegr ated
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
8 / 139
Our vision in 4 steps
MySQLDocumentStore
Relational&DocumentModels
MySQLHA
Out-Of-BoxHA
ReadScale-Out
AsyncReplication+A utoFailover
WriteScale-Out
Sharding
E1 E3
E2 E4
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
9 / 139
Step 2´s Architecture
Application
MySQLConnector
MySQLRouter
MySQLShell
InnoDB
cluster
Application
MySQLConnector
MySQLRouter
Mp
M
M
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
10 / 139
Step 3´s Architecture
Application
MySQLConnector
MySQLRouter
MySQLShell
InnoDB
cluster
Application
MySQLConnector
MySQLRouter
Mp
M
M
S1 S2 S3 S4 S...
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
11 / 139
Step 4´s Architecture
Application
MySQLConnector
MySQLRouter
MySQLShell
Application
MySQLConnector
MySQLRouter
InnoDB
cluster
Mp
M
M
S2 S3 S4 S...S1
InnoDB
cluster
Mp
M
M
S1 S2 S3 S4 S...
InnoDB
cluster
Mp
M
M
S1 S2 S3 S4 S...
Application
MySQLConnector
MySQLRouter
Application
MySQLConnector
MySQLRouter
Application
MySQLConnector
MySQLRouter
replicaset1
replicaset2
replicaset3
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
12 / 139
Group Replication: heart of MySQL InnoDB
Cluster
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
13 / 139
Group Replication: heart of MySQL InnoDB
Cluster
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
14 / 139
But before going further...
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
15 / 139
What is
High Availability ?
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
16 / 139
High Availability
High availability is a characteristicofa system, which aimstoensureanagreedlevelof
operational performance, usuallyuptime, for a higher thannormalperiod.
There are three principles of systemsdesigninreliabilityengineeringwhichcanhelp
achieve high availability:
Elimination of single points offailure. Thismeansaddingredundancyto the system
so that failure of a componentdoesnotmeanfailureoftheentiresystem.
Reliable crossover. In redundantsystems, thecrossover pointitselftendstobecome
a single point of failure. Reliablesystemsmustprovideforreliablecrossover.
Detection of failures as they occur. Ifthetwoprinciplesaboveareobserved,thena
user may never see a failure. Butthemaintenanceactivitymust.
Source: WikipediaCopyright @ 2017 Oracle and/or its affiliates. All rights reserved.
17 / 139
Database Redundancy
How to achieve it ?
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
18 / 139
Database Redundancy
How to achieve it ?
Multiple solutions exist, someworse thantheothers ;-)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
19 / 139
Database Redundancy
How to achieve it ?
Multiple solutions exist, someworse thantheothers ;-)
use of share storage
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
20 / 139
Database Redundancy
How to achieve it ?
Multiple solutions exist, someworse thantheothers ;-)
use of share storage
use of share blocs by network(drbd)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
21 / 139
Database Redundancy
How to achieve it ?
Multiple solutions exist, someworse thantheothers ;-)
use of share storage
use of share blocs by network(drbd)
use of MySQLreplication
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
22 / 139
Database Redundancy
How to achieve it ?
Multiple solutions exist, someworse thantheothers ;-)
use of share storage
use of share blocs by network(drbd)
use of MySQLreplication
Of course the last one is the technique most spread, more flexible and more reliable.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
23 / 139
MySQL Replication
There are multiple types of MySQLreplication:
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
24 / 139
MySQL Replication
There are multiple types of MySQLreplication:
asynchronous replication (async)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
25 / 139
MySQL Replication
There are multiple types of MySQLreplication:
asynchronous replication (async)
semi-synchronous replication(semi-sync)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
26 / 139
MySQL Replication
There are multiple types of MySQLreplication:
asynchronous replication (async)
semi-synchronous replication(semi-sync)
group replication -New since (5.7.17)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
27 / 139
Asynchronous Replication(s)
replicas (also called slaves) stream thereplication logs froma unique master (multi-
source replication is possiblesince5.7.6)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
28 / 139
Asynchronous Replication(s)
replicas (also called slaves) stream thereplication logs froma unique master (multi-
source replication is possiblesince5.7.6)
slaves can be laging (having delay), there isno delivery guarantee (unless for semi-
sync)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
29 / 139
Asynchronous Replication(s)
replicas (also called slaves) stream thereplication logs froma unique master (multi-
source replication is possiblesince5.7.6)
slaves can be laging (having delay), there isno delivery guarantee (unless for semi-
sync)
replicas provisioning is manual
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
30 / 139
Asynchronous Replication(s)
replicas (also called slaves) stream thereplication logs froma unique master (multi-
source replication is possiblesince5.7.6)
slaves can be laging (having delay), there isno delivery guarantee (unless for semi-
sync)
replicas provisioning is manual
data consistency on replicas is assumed and needs a manual verification
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
31 / 139
Asynchronous Replication(s)
replicas (also called slaves) stream thereplication logs froma unique master (multi-
source replication is possiblesince5.7.6)
slaves can be laging (having delay), there isno delivery guarantee (unless for semi-
sync)
replicas provisioning is manual
data consistency on replicas is assumed and needs a manual verification
it´s even possible to create circular replication (highly not recommended)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
32 / 139
Asynchronous Replication(s)
replicas (also called slaves) stream thereplication logs froma unique master (multi-
source replication is possiblesince5.7.6)
slaves can be laging (having delay), there isno delivery guarantee (unless for semi-
sync)
replicas provisioning is manual
data consistency on replicas is assumed and needs a manual verification
it´s even possible to create circular replication (highly not recommended)
write operations are safe onlyfrom a unique global master
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
33 / 139
Asynchronous Replication(s)
complex topologies can be built
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
34 / 139
Asynchronous Replication(s)
complex topologies can be built
1
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
35 / 139
Asynchronous Replication(s)
complex topologies can be built
1
32
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
36 / 139
Asynchronous Replication(s)
complex topologies can be built
1
32
4
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
37 / 139
Asynchronous Replication(s)
complex topologies can be built
1
32
4
5
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
38 / 139
Asynchronous Replication(s)
complex topologies can be built
1
32
4
5
6 7 8
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
39 / 139
Asynchronous Replication(s)
complex topologies can be built
1
32
4
5
6 7 8
9
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
40 / 139
Asynchronous Replication(s)
complex topologies can be built
1
32
4
5
6 7 8
9
10
14
15
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
41 / 139
Asynchronous Replication(s)
complex topologies can be built
1
32
4
5
6 7 8
9
10
11
14
15
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
42 / 139
Asynchronous Replication(s)
complex topologies can be built
1
32
4
5
6 7 8
9
10
11
12
14
15
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
43 / 139
Asynchronous Replication(s)
complex topologies can be built
1
32
4
5
6 7 8
9
10
11
12
13
14
15
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
44 / 139
Asynchronous Replication(s)
complex topologies can be built
1
32
4
5
6 7 8
9
10
11
12
13
14
15
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
45 / 139
MySQL HA Architectures with asynchronous
replication
It exists a lot of possible architectures and asmuch tools to enforce them.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
46 / 139
MySQL HA Architectures with asynchronous
replication
It exists a lot of possible architectures and asmuch tools to enforce them.
They are all based on the sameprinciple:
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
47 / 139
MySQL HA Architectures with asynchronous
replication
It exists a lot of possible architectures and asmuch tools to enforce them.
They are all based on the sameprinciple:
1 master
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
48 / 139
MySQL HA Architectures with asynchronous
replication
It exists a lot of possible architectures and asmuch tools to enforce them.
They are all based on the sameprinciple:
1 master
1 or many replicas (slaves)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
49 / 139
MySQL HA Architectures with asynchronous
replication
It exists a lot of possible architectures and asmuch tools to enforce them.
They are all based on the sameprinciple:
1 master
1 or many replicas (slaves)
If the master as an issue, the most accurate slave needs to takeover therole and be
promoted as master for all the remaining slaves still online.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
50 / 139
Automation
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
51 / 139
Automation
And this is the most complicated part...
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
52 / 139
Automation
And this is the most complicated part...
It exists a large amount of external tools that canbe used to achieve thistask.Most of
them are only compatible with GNU/Linux.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
53 / 139
Automation
And this is the most complicated part...
It exists a large amount of external tools that canbe used to achieve thistask.Most of
them are only compatible with GNU/Linux.
Their problem is that they create complexity inthearchitecture's design. You need to be
DBA & sysadmin to manage those solutions:
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
54 / 139
Automation
And this is the most complicated part...
It exists a large amount of external tools that canbe used to achieve thistask.Most of
them are only compatible with GNU/Linux.
Their problem is that they create complexity inthearchitecture's design. You need to be
DBA & sysadmin to manage those solutions:
MySQL-Utilities (mysqlrplcheck, mysqlrpladmin)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
55 / 139
Automation
And this is the most complicated part...
It exists a large amount of external tools that canbe used to achieve thistask.Most of
them are only compatible with GNU/Linux.
Their problem is that they create complexity inthearchitecture's design. You need to be
DBA & sysadmin to manage those solutions:
MySQL-Utilities (mysqlrplcheck, mysqlrpladmin)
Pacemaker withMySQLdedicated OCF
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
56 / 139
Automation
And this is the most complicated part...
It exists a large amount of external tools that canbe used to achieve thistask.Most of
them are only compatible with GNU/Linux.
Their problem is that they create complexity inthearchitecture's design. You need to be
DBA & sysadmin to manage those solutions:
MySQL-Utilities (mysqlrplcheck, mysqlrpladmin)
Pacemaker withMySQLdedicated OCF
MHA
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
57 / 139
MySQL Group Replication
but what is it ?!?
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
58 / 139
MySQL Group Replication
but what is it ?!?
GR is a plugin forMySQL, made byMySQLand packaged withMySQL
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
59 / 139
MySQL Group Replication
but what is it ?!?
GR is a plugin forMySQL, made byMySQLand packaged withMySQL
GR is an implementation of Replicated Database State Machine theory
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
60 / 139
MySQL Group Replication
but what is it ?!?
GR is a plugin forMySQL, made byMySQLand packaged withMySQL
GR is an implementation of Replicated Database State Machine theory
MySQLGroup Communication System(GCS) isbased on Paxos Mencius
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
61 / 139
MySQL Group Replication
but what is it ?!?
GR is a plugin forMySQL, made byMySQLand packaged withMySQL
GR is an implementation of Replicated Database State Machine theory
MySQLGroup Communication System(GCS) isbased on Paxos Mencius
GR allows to write on all Group Members (cluster nodes) simultaneously while
retaining consistency
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
62 / 139
MySQL Group Replication
but what is it ?!?
GR is a plugin forMySQL, made byMySQLand packaged withMySQL
GR is an implementation of Replicated Database State Machine theory
MySQLGroup Communication System(GCS) isbased on Paxos Mencius
GR allows to write on all Group Members (cluster nodes) simultaneously while
retaining consistency
GR implements conflict detection and resolution
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
63 / 139
MySQL Group Replication
but what is it ?!?
GR is a plugin forMySQL, made byMySQLand packaged withMySQL
GR is an implementation of Replicated Database State Machine theory
MySQLGroup Communication System(GCS) isbased on Paxos Mencius
GR allows to write on all Group Members (cluster nodes) simultaneously while
retaining consistency
GR implements conflict detection and resolution
GR allows automatic distributed recovery
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
64 / 139
MySQL Group Replication
but what is it ?!?
GR is a plugin forMySQL, made byMySQLand packaged withMySQL
GR is an implementation of Replicated Database State Machine theory
MySQLGroup Communication System(GCS) isbased on Paxos Mencius
GR allows to write on all Group Members (cluster nodes) simultaneously while
retaining consistency
GR implements conflict detection and resolution
GR allows automatic distributed recovery
Supported onallMySQLplatforms!!
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
65 / 139
MySQL Group Replication
but what is it ?!?
GR is a plugin forMySQL, made byMySQLand packaged withMySQL
GR is an implementation of Replicated Database State Machine theory
MySQLGroup Communication System(GCS) isbased on Paxos Mencius
GR allows to write on all Group Members (cluster nodes) simultaneously while
retaining consistency
GR implements conflict detection and resolution
GR allows automatic distributed recovery
Supported onallMySQLplatforms!!
Linux, Windows, Solaris, OSX,FreeBSD
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
66 / 139
And for users ?
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
67 / 139
And for users ?
no longer necessary to handleserver fail-over manually or with a complicated script
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
68 / 139
And for users ?
no longer necessary to handleserver fail-over manually or with a complicated script
GR provides fault tolerance
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
69 / 139
And for users ?
no longer necessary to handleserver fail-over manually or with a complicated script
GR provides fault tolerance
GR enables update-everywhere setups
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
70 / 139
And for users ?
no longer necessary to handleserver fail-over manually or with a complicated script
GR provides fault tolerance
GR enables update-everywhere setups
GR handles crashes, failures, re-connetcs automatically
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
71 / 139
And for users ?
no longer necessary to handleserver fail-over manually or with a complicated script
GR provides fault tolerance
GR enables update-everywhere setups
GR handles crashes, failures, re-connetcs automatically
Allows an easy setup of aMySQLservice high available !
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
72 / 139
OK, but how does it work ?
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
73 / 139
OK, but how does it work ?
it's just ...
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
74 / 139
OK, but how does it work ?
it's just ...
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
75 / 139
OK, but how does it work ?
it's just ...
... no, in fact the writesets replication issynchronousand then certification and apply of
the changes are local to each nodes and asynchronous.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
76 / 139
OK, but how does it work ?
it's just ...
... no, in fact the writesets replication issynchronousand then certification and apply of
the changes are local to each nodes and asynchronous.
not that easy to understand... right ? As a picture isworth a 1000words, let's illustrate
this...
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
77 / 139
MySQLGroup Replication
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
78 / 139
MySQLGroup Replication
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
79 / 139
MySQLGroup Replication
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
80 / 139
MySQLGroup Replication
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
81 / 139
MySQLGroup Replication
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
82 / 139
MySQLGroup Replication
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
83 / 139
MySQLGroup Replication
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
84 / 139
MySQLGroup Replication
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
85 / 139
MySQLGroup Replication
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
86 / 139
MySQLGroup Replication
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
87 / 139
MySQLGroup Replication
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
88 / 139
MySQLGroup Replication
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
89 / 139
Certification
Certification is the process that only needs to answer thefollowing unique question:
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
90 / 139
Certification
Certification is the process that only needs to answer thefollowing unique question:
can the write (transaction) beapplied?
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
91 / 139
Certification
Certification is the process that only needs to answer thefollowing unique question:
can the write (transaction) beapplied?
based on unapplied earlier transactions
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
92 / 139
Certification
Certification is the process that only needs to answer thefollowing unique question:
can the write (transaction) beapplied?
based on unapplied earlier transactions
such conflicts must come forother members/nodes
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
93 / 139
Certification
Certification is the process that only needs to answer thefollowing unique question:
can the write (transaction) beapplied?
based on unapplied earlier transactions
such conflicts must come forother members/nodes
happens on every member/node
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
94 / 139
Certification
Certification is the process that only needs to answer thefollowing unique question:
can the write (transaction) beapplied?
based on unapplied earlier transactions
such conflicts must come forother members/nodes
happens on every member/node
should be deterministic on every node
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
95 / 139
Certification
Certification is the process that only needs to answer thefollowing unique question:
can the write (transaction) beapplied?
based on unapplied earlier transactions
such conflicts must come forother members/nodes
happens on every member/node
should be deterministic on every node
results are not reported to thegroup
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
96 / 139
Certification
Certification is the process that only needs to answer thefollowing unique question:
can the write (transaction) beapplied?
based on unapplied earlier transactions
such conflicts must come forother members/nodes
happens on every member/node
should be deterministic on every node
results are not reported to thegroup
pass: enter in the apply queue
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
97 / 139
Certification
Certification is the process that only needs to answer thefollowing unique question:
can the write (transaction) beapplied?
based on unapplied earlier transactions
such conflicts must come forother members/nodes
happens on every member/node
should be deterministic on every node
results are not reported to thegroup
pass: enter in the apply queue
fail: drop the transaction
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
98 / 139
Certification
Certification is the process that only needs to answer thefollowing unique question:
can the write (transaction) beapplied?
based on unapplied earlier transactions
such conflicts must come forother members/nodes
happens on every member/node
should be deterministic on every node
results are not reported to thegroup
pass: enter in the apply queue
fail: drop the transaction
serialized by the total order in GCS/XCOM+ GTID
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
99 / 139
Certification
Certification is the process that only needs to answer thefollowing unique question:
can the write (transaction) beapplied?
based on unapplied earlier transactions
such conflicts must come forother members/nodes
happens on every member/node
should be deterministic on every node
results are not reported to thegroup
pass: enter in the apply queue
fail: drop the transaction
serialized by the total order in GCS/XCOM+ GTID
cost is based on trx size (# rows &# keys)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
100 / 139
GTID
GTIDs are the same as those used by asynchronous replication.
mysql> SELECT * FROM performance_schema.replication_connection_statusG
************************** 1. row ***************************
CHANNEL_NAME: group_replication_applier
GROUP_NAME: afb80f36-2bff-11e6-84e0-0800277dd3bf
SOURCE_UUID: afb80f36-2bff-11e6-84e0-0800277dd3bf
THREAD_ID: NULL
SERVICE_STATE: ON
COUNT_RECEIVED_HEARTBEATS: 0
LAST_HEARTBEAT_TIMESTAMP: 0000-00-00 00:00:00
RECEIVED_TRANSACTION_SET: afb80f36-2bff-11e6-84e0-0800277dd3bf:1-57,
f037578b-46b1-11e6-8005-08002774c31b:1-48937
LAST_ERROR_NUMBER: 0
LAST_ERROR_MESSAGE:
LAST_ERROR_TIMESTAMP: 0000-00-00 00:00:00
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
101 / 139
but transactions use the Group´s GTID
mysql> show master statusG
************************** 1. row ***************************
File: mysql4-bin.000001
Position: 1501
Binlog_Do_DB:
Binlog_Ignore_DB:
Executed_Gtid_Set: afb80f36-2bff-11e6-84e0-0800277dd3bf:1-57,
f037578b-46b1-11e6-8005-08002774c31b:1-48937
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
102 / 139
Requirements
exclusively works with InnoDBtables only
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
103 / 139
Requirements
exclusively works with InnoDBtables only
every tables must have a PK defined
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
104 / 139
Requirements
exclusively works with InnoDBtables only
every tables must have a PK defined
only IPV4 is supported
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
105 / 139
Requirements
exclusively works with InnoDBtables only
every tables must have a PK defined
only IPV4 is supported
a good network with low latency isimportant
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
106 / 139
Requirements
exclusively works with InnoDBtables only
every tables must have a PK defined
only IPV4 is supported
a good network with low latency isimportant
maximum of 9 members per group
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
107 / 139
Requirements
exclusively works with InnoDBtables only
every tables must have a PK defined
only IPV4 is supported
a good network with low latency isimportant
maximum of 9 members per group
log-bin must be enabled and onlyROWformat is supported
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
108 / 139
Requirements (2)
enable GTIDs
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
109 / 139
Requirements (2)
enable GTIDs
replication meta-data must bestored insystem tables
--master-info-repository=TABLE
--relay-log-info-repository=TABLE
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
110 / 139
Requirements (2)
enable GTIDs
replication meta-data must bestored insystem tables
--master-info-repository=TABLE
--relay-log-info-repository=TABLE
writesets extraction must be enabled
--transaction-write-set-extraction=XXHASH64
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
111 / 139
Requirements (2)
enable GTIDs
replication meta-data must bestored insystem tables
--master-info-repository=TABLE
--relay-log-info-repository=TABLE
writesets extraction must be enabled
--transaction-write-set-extraction=XXHASH64
log-slave-updates must alsobe enabled
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
112 / 139
Limitations
binlog checksum is not supported (but we have checksum in the replicationchannel)
--binlog-checksum=NONE
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
113 / 139
Limitations
binlog checksum is not supported (but we have checksum in the replicationchannel)
--binlog-checksum=NONE
savepointswere not supported before 5.7.19& 8.0.1
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
114 / 139
Limitations
binlog checksum is not supported (but we have checksum in the replicationchannel)
--binlog-checksum=NONE
savepointswere not supported before 5.7.19& 8.0.1
SERIALIZABLEis not supported as transaction isolation level
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
115 / 139
Limitations
binlog checksum is not supported (but we have checksum in the replicationchannel)
--binlog-checksum=NONE
savepointswere not supported before 5.7.19& 8.0.1
SERIALIZABLEis not supported as transaction isolation level
http://lefred.be/content/mysql-group-replication-limitations-savepoints/
http://lefred.be/content/mysql-group-replication-and-table-design/
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
116 / 139
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
117 / 139
MySQL Router (GA!)
MySQLRouter is lightweight middleware that provides transparent routing between your
application and backendMySQLServers. It can be used for awide variety of use cases,
such as providing high availability and scalability by effectively routing database trafficto
appropriate backendMySQLServers.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
118 / 139
MySQL Router (GA!)
MySQLRouter is lightweight middleware that provides transparent routing between your
application and backendMySQLServers. It can be used for awide variety of use cases,
such as providing high availability and scalability by effectively routing database trafficto
appropriate backendMySQLServers.
MySQLRouter doesn´t require any specific configuration. Itconfigures itself automatically
(bootstrap) usingMySQLInnoDB Cluster´s metadata.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
119 / 139
MySQL Router (GA!)
MySQLRouter is lightweight middleware that provides transparent routing between your
application and backendMySQLServers. It can be used for awide variety of use cases,
such as providing high availability and scalability by effectively routing database trafficto
appropriate backendMySQLServers.
MySQLRouter doesn´t require any specific configuration. Itconfigures itself automatically
(bootstrap) usingMySQLInnoDB Cluster´s metadata.
TheMySQLRouter development will be focusing on sharding.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
120 / 139
ProxySQLhas native support for Group
Replication which makes it a good choice for
advanced users.
ProxySQL
If you need some specific features that are not yet available inMySQLRouter, like
transparent R/W splitting, then you canuse your software of choice.
We are also collaborating with ProxySQL.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
121 / 139
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
122 / 139
MySQL Shell (GA!)
TheMySQLShell is an interactive Javascript, Python, or SQLinterface supporting
development and administration for theMySQLServer and is acomponent of theMySQL
Server. You can use theMySQLShell to perform data queriesand updates aswell as
various administration operations.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
123 / 139
MySQL Shell (2)
TheMySQLShell provides:
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
124 / 139
MySQL Shell (2)
TheMySQLShell provides:
Both Interactive and Batch operations
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
125 / 139
MySQL Shell (2)
TheMySQLShell provides:
Both Interactive and Batch operations
Document and Relational Models
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
126 / 139
MySQL Shell (2)
TheMySQLShell provides:
Both Interactive and Batch operations
Document and Relational Models
CRUD Document and Relational APIs via scripting
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
127 / 139
MySQL Shell (2)
TheMySQLShell provides:
Both Interactive and Batch operations
Document and Relational Models
CRUD Document and Relational APIs via scripting
Traditional Table, JSON, Tab Separated output results formats
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
128 / 139
MySQL Shell (2)
TheMySQLShell provides:
Both Interactive and Batch operations
Document and Relational Models
CRUD Document and Relational APIs via scripting
Traditional Table, JSON, Tab Separated output results formats
MySQLStandard and X Protocols
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
129 / 139
MySQL Shell (2)
TheMySQLShell provides:
Both Interactive and Batch operations
Document and Relational Models
CRUD Document and Relational APIs via scripting
Traditional Table, JSON, Tab Separated output results formats
MySQLStandard and X Protocols
and more...
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
130 / 139
MySQL Shell (3)
PREVIEW: the new Shell´s prompt is nice and clear !
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
131 / 139
don´t forget, this is a HA solution !
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
132 / 139
Deploying a MySQL using MySQL Shell´s
adminAPI:
mysql-js> var i1 = 'root@instance01.boston:3306';
mysql-js> var i2 = 'root@instance02.boston:3306';
mysql-js> var i3 = 'root@instance03.boston:3306';
mysql-js> dba.checkInstanceCon guration(i1);
mysql-js> dba.checkInstanceCon guration(i2);
mysql-js> dba.checkInstanceCon guration(i3);
mysql-js> shell.connect(i1);
mysql-js> var cluster = dba.createCluster('BostonMUG');
mysql-js> cluster.checkInstanceState(i2);
mysql-js> cluster.addInstance(i2);
mysql-js> cluster.checkInstanceState(i3);
mysql-js> cluster.addInstance(i3);
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
133 / 139
Demo
https://www.youtube.com/watch?v=gqKdw4QzbzE
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
134 / 139
instance01.yaml :
classes:
- innodbcluster
innodbcluster::mysql_serverid: 1
Thanks to the shell we can automate everything ;-)
https://github.com/lefred/puppet-lefred-innodbcluster
Super easy using hiera:
common.yaml:
innodbcluster::mysql_root_password: StRongP4ssw0rD!
innodbcluster::mysql_bind_interface: eth1
innodbcluster::cluster_name: BostonMUG
innodbcluster::grant::user: fred
innodbcluster::grant::password: fred
innodbcluster::seed: instance01.boston
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
135 / 139
example (2)
Withhiera-eyaml you can even encrypt your password:
innodbcluster::mysql_root_password: >
ENC[PKCS7,MIIBeQYJKoZIhvcNAQcDoIIBajCCAWYCAQAxggEhMIIBHQIBADAFMAACAQEw
DQYJKoZIhvcNAQEBBQAEggEAhqKUTXZ/4L8/aL3XARMfDBEI+s5HPshPg9BI
...
FLfovstrb8zmcbk5yb/KD0lDM8Elas0lrnpk8MxwNfKw+hB299JFp8ldAtUk
ODIieTA8BgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBBJEeoyzHtW/WGpbiUz
gcXTgBAnb1gGrBZAfAiv/ztwuZ9z]
innodbcluster::mysql_bind_interface: eth1
innodbcluster::cluster_name: BostonMUG
innodbcluster::grant::user: root
innodbcluster::grant::password: >
ENC[PKCS7,MIIBeQYJKoZIhvcNAQcDoIIBajCCAWYCAQAxggEhMIIBHQIBADAFMAACAQEw
DQYJKoZIhvcNAQEBBQAEggEAhqKUTXZ/4L8/aL3XARMfDBEI+s5HPshPg9BI
...
FLfovstrb8zmcbk5yb/KD0lDM8Elas0lrnpk8MxwNfKw+hB299JFp8ldAtUk
ODIieTA8BgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBBJEeoyzHtW/WGpbiUz
gcXTgBAnb1gGrBZAfAiv/ztwuZ9z]
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
136 / 139
Demo !
https://www.youtube.com/watch?v=skwlmBNE7ts
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
137 / 139
Resources
http://lefred.be/content/mysql-innodb-cluster-mysql-shell-starter-guide/
http://lefred.be/content/mysql-innodb-cluster-automated-installation-with-puppet/
http://lefred.be/content/category/mysql/group-replication/
https://www.slideshare.net/lefred.descamps/mysql-devops-webinar
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
138 / 139
Thank you !
Any Questions ?
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
139 / 139

More Related Content

What's hot

Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB ClusterWebinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Continuent
 

What's hot (20)

Inexpensive Datamasking for MySQL with ProxySQL - data anonymization for deve...
Inexpensive Datamasking for MySQL with ProxySQL - data anonymization for deve...Inexpensive Datamasking for MySQL with ProxySQL - data anonymization for deve...
Inexpensive Datamasking for MySQL with ProxySQL - data anonymization for deve...
 
MySQL InnoDB Cluster and Group Replication in a Nutshell
MySQL InnoDB Cluster and Group Replication in a NutshellMySQL InnoDB Cluster and Group Replication in a Nutshell
MySQL InnoDB Cluster and Group Replication in a Nutshell
 
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB ClusterWebinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
 
MySQL Devops Webinar
MySQL Devops WebinarMySQL Devops Webinar
MySQL Devops Webinar
 
MySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn TutorialMySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn Tutorial
 
Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB Cluster
 
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 InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group ReplicationMySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group Replication
 
MySQL Replication Performance Tuning for Fun and Profit!
MySQL Replication Performance Tuning for Fun and Profit!MySQL Replication Performance Tuning for Fun and Profit!
MySQL Replication Performance Tuning for Fun and Profit!
 
MySQL Document Store - when SQL & NoSQL live together... in peace!
MySQL Document Store - when SQL & NoSQL live together... in peace!MySQL Document Store - when SQL & NoSQL live together... in peace!
MySQL Document Store - when SQL & NoSQL live together... in peace!
 
High Availability in MySQL 8 using InnoDB Cluster
High Availability in MySQL 8 using InnoDB ClusterHigh Availability in MySQL 8 using InnoDB Cluster
High Availability in MySQL 8 using InnoDB Cluster
 
Everything You Need to Know About MySQL Group Replication
Everything You Need to Know About MySQL Group ReplicationEverything You Need to Know About MySQL Group Replication
Everything You Need to Know About MySQL Group Replication
 
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
 
MySQL Group Replicatio in a nutshell - MySQL InnoDB Cluster
MySQL Group Replicatio  in a nutshell - MySQL InnoDB ClusterMySQL Group Replicatio  in a nutshell - MySQL InnoDB Cluster
MySQL Group Replicatio in a nutshell - MySQL InnoDB Cluster
 
Introduction to MySQL Document Store
Introduction to MySQL Document StoreIntroduction to MySQL Document Store
Introduction to MySQL Document Store
 
MySQL Document Store - How to replace a NoSQL database by MySQL without effor...
MySQL Document Store - How to replace a NoSQL database by MySQL without effor...MySQL Document Store - How to replace a NoSQL database by MySQL without effor...
MySQL Document Store - How to replace a NoSQL database by MySQL without effor...
 
Mix ‘n’ Match Async and Group Replication for Advanced Replication Setups
Mix ‘n’ Match Async and Group Replication for Advanced Replication SetupsMix ‘n’ Match Async and Group Replication for Advanced Replication Setups
Mix ‘n’ Match Async and Group Replication for Advanced Replication Setups
 
devops Days Belgium Ghent 2016
devops Days Belgium Ghent 2016devops Days Belgium Ghent 2016
devops Days Belgium Ghent 2016
 
MySQL High Availability with Group Replication
MySQL High Availability with Group ReplicationMySQL High Availability with Group Replication
MySQL High Availability with Group Replication
 
MySQL InnoDB Cluster in a Nutshell - Hands-on Lab
MySQL InnoDB Cluster in a Nutshell - Hands-on LabMySQL InnoDB Cluster in a Nutshell - Hands-on Lab
MySQL InnoDB Cluster in a Nutshell - Hands-on Lab
 

Similar to Boston meetup : MySQL Innodb Cluster - May 1st 2017

Similar to Boston meetup : MySQL Innodb Cluster - May 1st 2017 (20)

DataOps Barcelona - MySQL HA so easy... that's insane !
DataOps Barcelona - MySQL HA so easy... that's insane !DataOps Barcelona - MySQL HA so easy... that's insane !
DataOps Barcelona - MySQL HA so easy... that's insane !
 
20191001 bkk-secret-of inno-db_clusterv1
20191001 bkk-secret-of inno-db_clusterv120191001 bkk-secret-of inno-db_clusterv1
20191001 bkk-secret-of inno-db_clusterv1
 
MySQL no Paypal Tesla e Uber
MySQL no Paypal Tesla e UberMySQL no Paypal Tesla e Uber
MySQL no Paypal Tesla e Uber
 
Solving Performance Problems Using MySQL Enterprise Monitor
Solving Performance Problems Using MySQL Enterprise MonitorSolving Performance Problems Using MySQL Enterprise Monitor
Solving Performance Problems Using MySQL Enterprise Monitor
 
DataOpsbarcelona 2019: Deep dive into MySQL Group Replication... the magic e...
DataOpsbarcelona 2019:  Deep dive into MySQL Group Replication... the magic e...DataOpsbarcelona 2019:  Deep dive into MySQL Group Replication... the magic e...
DataOpsbarcelona 2019: Deep dive into MySQL Group Replication... the magic e...
 
MySQL InnoDB Cluster and Group Replication in a nutshell hands-on tutorial
MySQL InnoDB Cluster and Group Replication in a nutshell  hands-on tutorialMySQL InnoDB Cluster and Group Replication in a nutshell  hands-on tutorial
MySQL InnoDB Cluster and Group Replication in a nutshell hands-on tutorial
 
20190615 hkos-mysql-troubleshootingandperformancev2
20190615 hkos-mysql-troubleshootingandperformancev220190615 hkos-mysql-troubleshootingandperformancev2
20190615 hkos-mysql-troubleshootingandperformancev2
 
Get the most out of Oracle Data Guard - OOW version
Get the most out of Oracle Data Guard - OOW versionGet the most out of Oracle Data Guard - OOW version
Get the most out of Oracle Data Guard - OOW version
 
MySQL Community Meetup in China : Innovation driven by the Community
MySQL Community Meetup in China : Innovation driven by the CommunityMySQL Community Meetup in China : Innovation driven by the Community
MySQL Community Meetup in China : Innovation driven by the Community
 
Cloud Native Java:GraalVM
Cloud Native Java:GraalVMCloud Native Java:GraalVM
Cloud Native Java:GraalVM
 
Cloud Native 자바 플랫폼: Graalvm Overview
Cloud Native 자바 플랫폼: Graalvm OverviewCloud Native 자바 플랫폼: Graalvm Overview
Cloud Native 자바 플랫폼: Graalvm Overview
 
Collaborate 17 Oracle RAC 12cRel 2 Best Practices
Collaborate 17 Oracle RAC 12cRel 2 Best PracticesCollaborate 17 Oracle RAC 12cRel 2 Best Practices
Collaborate 17 Oracle RAC 12cRel 2 Best Practices
 
20190817 coscup-oracle my sql innodb cluster sharing
20190817 coscup-oracle my sql innodb cluster sharing20190817 coscup-oracle my sql innodb cluster sharing
20190817 coscup-oracle my sql innodb cluster sharing
 
MySQL Innovation Day Chicago - MySQL HA So Easy : That's insane !!
MySQL Innovation Day Chicago  - MySQL HA So Easy : That's insane !!MySQL Innovation Day Chicago  - MySQL HA So Easy : That's insane !!
MySQL Innovation Day Chicago - MySQL HA So Easy : That's insane !!
 
MySQL 5.7 InnoDB Cluster (Jan 2018)
MySQL 5.7 InnoDB Cluster (Jan 2018)MySQL 5.7 InnoDB Cluster (Jan 2018)
MySQL 5.7 InnoDB Cluster (Jan 2018)
 
Sparc SuperCluster
Sparc SuperClusterSparc SuperCluster
Sparc SuperCluster
 
MySQL Replication
MySQL ReplicationMySQL Replication
MySQL Replication
 
gDBClone - Database Clone “onecommand Automation Tool”
gDBClone - Database Clone “onecommand Automation Tool”gDBClone - Database Clone “onecommand Automation Tool”
gDBClone - Database Clone “onecommand Automation Tool”
 
How to operate MySQL InnoDB Cluster with MySQL Shell
How to operate MySQL InnoDB Cluster with MySQL ShellHow to operate MySQL InnoDB Cluster with MySQL Shell
How to operate MySQL InnoDB Cluster with MySQL Shell
 
MySQL NoSQL APIs
MySQL NoSQL APIsMySQL NoSQL APIs
MySQL NoSQL APIs
 

More from Frederic Descamps

More from Frederic Descamps (20)

MySQL Innovation & Cloud Day - Document Store avec MySQL HeatWave Database Se...
MySQL Innovation & Cloud Day - Document Store avec MySQL HeatWave Database Se...MySQL Innovation & Cloud Day - Document Store avec MySQL HeatWave Database Se...
MySQL Innovation & Cloud Day - Document Store avec MySQL HeatWave Database Se...
 
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code ExtensionMySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
 
RivieraJUG - MySQL Indexes and Histograms
RivieraJUG - MySQL Indexes and HistogramsRivieraJUG - MySQL Indexes and Histograms
RivieraJUG - MySQL Indexes and Histograms
 
RivieraJUG - MySQL 8.0 - What's new for developers.pdf
RivieraJUG - MySQL 8.0 - What's new for developers.pdfRivieraJUG - MySQL 8.0 - What's new for developers.pdf
RivieraJUG - MySQL 8.0 - What's new for developers.pdf
 
MySQL User Group NL - MySQL 8
MySQL User Group NL - MySQL 8MySQL User Group NL - MySQL 8
MySQL User Group NL - MySQL 8
 
State of the Dolphin - May 2022
State of the Dolphin - May 2022State of the Dolphin - May 2022
State of the Dolphin - May 2022
 
Percona Live 2022 - MySQL Shell for Visual Studio Code
Percona Live 2022 - MySQL Shell for Visual Studio CodePercona Live 2022 - MySQL Shell for Visual Studio Code
Percona Live 2022 - MySQL Shell for Visual Studio Code
 
Percona Live 2022 - The Evolution of a MySQL Database System
Percona Live 2022 - The Evolution of a MySQL Database SystemPercona Live 2022 - The Evolution of a MySQL Database System
Percona Live 2022 - The Evolution of a MySQL Database System
 
Percona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL ArchitecturesPercona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL Architectures
 
LinuxFest Northwest 2022 - The Evolution of a MySQL Database System
LinuxFest Northwest 2022 - The Evolution of a MySQL Database SystemLinuxFest Northwest 2022 - The Evolution of a MySQL Database System
LinuxFest Northwest 2022 - The Evolution of a MySQL Database System
 
Open Source 101 2022 - MySQL Indexes and Histograms
Open Source 101 2022 - MySQL Indexes and HistogramsOpen Source 101 2022 - MySQL Indexes and Histograms
Open Source 101 2022 - MySQL Indexes and Histograms
 
Pi Day 2022 - from IoT to MySQL HeatWave Database Service
Pi Day 2022 -  from IoT to MySQL HeatWave Database ServicePi Day 2022 -  from IoT to MySQL HeatWave Database Service
Pi Day 2022 - from IoT to MySQL HeatWave Database Service
 
Confoo 2022 - le cycle d'une instance MySQL
Confoo 2022  - le cycle d'une instance MySQLConfoo 2022  - le cycle d'une instance MySQL
Confoo 2022 - le cycle d'une instance MySQL
 
FOSDEM 2022 MySQL Devroom: MySQL 8.0 - Logical Backups, Snapshots and Point-...
FOSDEM 2022 MySQL Devroom:  MySQL 8.0 - Logical Backups, Snapshots and Point-...FOSDEM 2022 MySQL Devroom:  MySQL 8.0 - Logical Backups, Snapshots and Point-...
FOSDEM 2022 MySQL Devroom: MySQL 8.0 - Logical Backups, Snapshots and Point-...
 
Les nouveautés de MySQL 8.0
Les nouveautés de MySQL 8.0Les nouveautés de MySQL 8.0
Les nouveautés de MySQL 8.0
 
Les nouveautés de MySQL 8.0
Les nouveautés de MySQL 8.0Les nouveautés de MySQL 8.0
Les nouveautés de MySQL 8.0
 
State of The Dolphin - May 2021
State of The Dolphin - May 2021State of The Dolphin - May 2021
State of The Dolphin - May 2021
 
MySQL Shell for DBAs
MySQL Shell for DBAsMySQL Shell for DBAs
MySQL Shell for DBAs
 
Deploying Magento on OCI with MDS
Deploying Magento on OCI with MDSDeploying Magento on OCI with MDS
Deploying Magento on OCI with MDS
 
MySQL Router REST API
MySQL Router REST APIMySQL Router REST API
MySQL Router REST API
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

Boston meetup : MySQL Innodb Cluster - May 1st 2017

  • 3. MySQL InnoDB Cluster When MySQL High Availability is Made Easy   The Boston MySQL Meetup Group - May 2017 3 / 139
  • 4.   Safe Harbor Statement The following is intended to outline our generalproduct direction. It isintended for information purpose only, and may not be incorporated into any contract. It isnot a commitment to deliver any material, code, or functionality, and should not be relied up in making purchasing decisions. Thedevelopment, release and timing of any features or functionality described for Oracle´s product remains at thesole discretion of Oracle. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 4 / 139
  • 5. about.me/lefred Who am I ? Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 5 / 139
  • 6. Frédéric Descamps @lefred MySQLEvangelist HackingMySQLsince 3.23 devops believer MySQLCommunity Manager since May 2016 (🎂) living in Belgium 🇧🇪 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 6 / 139
  • 7. MySQL InnoDB Cluster Easy MySQL High Availability Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 7 / 139
  • 9. Our vision in 4 steps MySQLDocumentStore Relational&DocumentModels MySQLHA Out-Of-BoxHA ReadScale-Out AsyncReplication+A utoFailover WriteScale-Out Sharding E1 E3 E2 E4 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 9 / 139
  • 11. Step 3´s Architecture Application MySQLConnector MySQLRouter MySQLShell InnoDB cluster Application MySQLConnector MySQLRouter Mp M M S1 S2 S3 S4 S... Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 11 / 139
  • 12. Step 4´s Architecture Application MySQLConnector MySQLRouter MySQLShell Application MySQLConnector MySQLRouter InnoDB cluster Mp M M S2 S3 S4 S...S1 InnoDB cluster Mp M M S1 S2 S3 S4 S... InnoDB cluster Mp M M S1 S2 S3 S4 S... Application MySQLConnector MySQLRouter Application MySQLConnector MySQLRouter Application MySQLConnector MySQLRouter replicaset1 replicaset2 replicaset3 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 12 / 139
  • 13. Group Replication: heart of MySQL InnoDB Cluster Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 13 / 139
  • 14. Group Replication: heart of MySQL InnoDB Cluster Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 14 / 139
  • 15. But before going further... Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 15 / 139
  • 16. What is High Availability ? Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 16 / 139
  • 17. High Availability High availability is a characteristicofa system, which aimstoensureanagreedlevelof operational performance, usuallyuptime, for a higher thannormalperiod. There are three principles of systemsdesigninreliabilityengineeringwhichcanhelp achieve high availability: Elimination of single points offailure. Thismeansaddingredundancyto the system so that failure of a componentdoesnotmeanfailureoftheentiresystem. Reliable crossover. In redundantsystems, thecrossover pointitselftendstobecome a single point of failure. Reliablesystemsmustprovideforreliablecrossover. Detection of failures as they occur. Ifthetwoprinciplesaboveareobserved,thena user may never see a failure. Butthemaintenanceactivitymust. Source: WikipediaCopyright @ 2017 Oracle and/or its affiliates. All rights reserved. 17 / 139
  • 18. Database Redundancy How to achieve it ? Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 18 / 139
  • 19. Database Redundancy How to achieve it ? Multiple solutions exist, someworse thantheothers ;-) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 19 / 139
  • 20. Database Redundancy How to achieve it ? Multiple solutions exist, someworse thantheothers ;-) use of share storage Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 20 / 139
  • 21. Database Redundancy How to achieve it ? Multiple solutions exist, someworse thantheothers ;-) use of share storage use of share blocs by network(drbd) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 21 / 139
  • 22. Database Redundancy How to achieve it ? Multiple solutions exist, someworse thantheothers ;-) use of share storage use of share blocs by network(drbd) use of MySQLreplication Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 22 / 139
  • 23. Database Redundancy How to achieve it ? Multiple solutions exist, someworse thantheothers ;-) use of share storage use of share blocs by network(drbd) use of MySQLreplication Of course the last one is the technique most spread, more flexible and more reliable. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 23 / 139
  • 24. MySQL Replication There are multiple types of MySQLreplication: Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 24 / 139
  • 25. MySQL Replication There are multiple types of MySQLreplication: asynchronous replication (async) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 25 / 139
  • 26. MySQL Replication There are multiple types of MySQLreplication: asynchronous replication (async) semi-synchronous replication(semi-sync) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 26 / 139
  • 27. MySQL Replication There are multiple types of MySQLreplication: asynchronous replication (async) semi-synchronous replication(semi-sync) group replication -New since (5.7.17) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 27 / 139
  • 28. Asynchronous Replication(s) replicas (also called slaves) stream thereplication logs froma unique master (multi- source replication is possiblesince5.7.6) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 28 / 139
  • 29. Asynchronous Replication(s) replicas (also called slaves) stream thereplication logs froma unique master (multi- source replication is possiblesince5.7.6) slaves can be laging (having delay), there isno delivery guarantee (unless for semi- sync) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 29 / 139
  • 30. Asynchronous Replication(s) replicas (also called slaves) stream thereplication logs froma unique master (multi- source replication is possiblesince5.7.6) slaves can be laging (having delay), there isno delivery guarantee (unless for semi- sync) replicas provisioning is manual Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 30 / 139
  • 31. Asynchronous Replication(s) replicas (also called slaves) stream thereplication logs froma unique master (multi- source replication is possiblesince5.7.6) slaves can be laging (having delay), there isno delivery guarantee (unless for semi- sync) replicas provisioning is manual data consistency on replicas is assumed and needs a manual verification Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 31 / 139
  • 32. Asynchronous Replication(s) replicas (also called slaves) stream thereplication logs froma unique master (multi- source replication is possiblesince5.7.6) slaves can be laging (having delay), there isno delivery guarantee (unless for semi- sync) replicas provisioning is manual data consistency on replicas is assumed and needs a manual verification it´s even possible to create circular replication (highly not recommended) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 32 / 139
  • 33. Asynchronous Replication(s) replicas (also called slaves) stream thereplication logs froma unique master (multi- source replication is possiblesince5.7.6) slaves can be laging (having delay), there isno delivery guarantee (unless for semi- sync) replicas provisioning is manual data consistency on replicas is assumed and needs a manual verification it´s even possible to create circular replication (highly not recommended) write operations are safe onlyfrom a unique global master Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 33 / 139
  • 34. Asynchronous Replication(s) complex topologies can be built Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 34 / 139
  • 35. Asynchronous Replication(s) complex topologies can be built 1 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 35 / 139
  • 36. Asynchronous Replication(s) complex topologies can be built 1 32 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 36 / 139
  • 37. Asynchronous Replication(s) complex topologies can be built 1 32 4 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 37 / 139
  • 38. Asynchronous Replication(s) complex topologies can be built 1 32 4 5 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 38 / 139
  • 39. Asynchronous Replication(s) complex topologies can be built 1 32 4 5 6 7 8 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 39 / 139
  • 40. Asynchronous Replication(s) complex topologies can be built 1 32 4 5 6 7 8 9 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 40 / 139
  • 41. Asynchronous Replication(s) complex topologies can be built 1 32 4 5 6 7 8 9 10 14 15 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 41 / 139
  • 42. Asynchronous Replication(s) complex topologies can be built 1 32 4 5 6 7 8 9 10 11 14 15 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 42 / 139
  • 43. Asynchronous Replication(s) complex topologies can be built 1 32 4 5 6 7 8 9 10 11 12 14 15 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 43 / 139
  • 44. Asynchronous Replication(s) complex topologies can be built 1 32 4 5 6 7 8 9 10 11 12 13 14 15 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 44 / 139
  • 45. Asynchronous Replication(s) complex topologies can be built 1 32 4 5 6 7 8 9 10 11 12 13 14 15 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 45 / 139
  • 46. MySQL HA Architectures with asynchronous replication It exists a lot of possible architectures and asmuch tools to enforce them. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 46 / 139
  • 47. MySQL HA Architectures with asynchronous replication It exists a lot of possible architectures and asmuch tools to enforce them. They are all based on the sameprinciple: Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 47 / 139
  • 48. MySQL HA Architectures with asynchronous replication It exists a lot of possible architectures and asmuch tools to enforce them. They are all based on the sameprinciple: 1 master Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 48 / 139
  • 49. MySQL HA Architectures with asynchronous replication It exists a lot of possible architectures and asmuch tools to enforce them. They are all based on the sameprinciple: 1 master 1 or many replicas (slaves) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 49 / 139
  • 50. MySQL HA Architectures with asynchronous replication It exists a lot of possible architectures and asmuch tools to enforce them. They are all based on the sameprinciple: 1 master 1 or many replicas (slaves) If the master as an issue, the most accurate slave needs to takeover therole and be promoted as master for all the remaining slaves still online. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 50 / 139
  • 51. Automation Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 51 / 139
  • 52. Automation And this is the most complicated part... Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 52 / 139
  • 53. Automation And this is the most complicated part... It exists a large amount of external tools that canbe used to achieve thistask.Most of them are only compatible with GNU/Linux. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 53 / 139
  • 54. Automation And this is the most complicated part... It exists a large amount of external tools that canbe used to achieve thistask.Most of them are only compatible with GNU/Linux. Their problem is that they create complexity inthearchitecture's design. You need to be DBA & sysadmin to manage those solutions: Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 54 / 139
  • 55. Automation And this is the most complicated part... It exists a large amount of external tools that canbe used to achieve thistask.Most of them are only compatible with GNU/Linux. Their problem is that they create complexity inthearchitecture's design. You need to be DBA & sysadmin to manage those solutions: MySQL-Utilities (mysqlrplcheck, mysqlrpladmin) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 55 / 139
  • 56. Automation And this is the most complicated part... It exists a large amount of external tools that canbe used to achieve thistask.Most of them are only compatible with GNU/Linux. Their problem is that they create complexity inthearchitecture's design. You need to be DBA & sysadmin to manage those solutions: MySQL-Utilities (mysqlrplcheck, mysqlrpladmin) Pacemaker withMySQLdedicated OCF Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 56 / 139
  • 57. Automation And this is the most complicated part... It exists a large amount of external tools that canbe used to achieve thistask.Most of them are only compatible with GNU/Linux. Their problem is that they create complexity inthearchitecture's design. You need to be DBA & sysadmin to manage those solutions: MySQL-Utilities (mysqlrplcheck, mysqlrpladmin) Pacemaker withMySQLdedicated OCF MHA Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 57 / 139
  • 58. MySQL Group Replication but what is it ?!? Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 58 / 139
  • 59. MySQL Group Replication but what is it ?!? GR is a plugin forMySQL, made byMySQLand packaged withMySQL Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 59 / 139
  • 60. MySQL Group Replication but what is it ?!? GR is a plugin forMySQL, made byMySQLand packaged withMySQL GR is an implementation of Replicated Database State Machine theory Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 60 / 139
  • 61. MySQL Group Replication but what is it ?!? GR is a plugin forMySQL, made byMySQLand packaged withMySQL GR is an implementation of Replicated Database State Machine theory MySQLGroup Communication System(GCS) isbased on Paxos Mencius Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 61 / 139
  • 62. MySQL Group Replication but what is it ?!? GR is a plugin forMySQL, made byMySQLand packaged withMySQL GR is an implementation of Replicated Database State Machine theory MySQLGroup Communication System(GCS) isbased on Paxos Mencius GR allows to write on all Group Members (cluster nodes) simultaneously while retaining consistency Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 62 / 139
  • 63. MySQL Group Replication but what is it ?!? GR is a plugin forMySQL, made byMySQLand packaged withMySQL GR is an implementation of Replicated Database State Machine theory MySQLGroup Communication System(GCS) isbased on Paxos Mencius GR allows to write on all Group Members (cluster nodes) simultaneously while retaining consistency GR implements conflict detection and resolution Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 63 / 139
  • 64. MySQL Group Replication but what is it ?!? GR is a plugin forMySQL, made byMySQLand packaged withMySQL GR is an implementation of Replicated Database State Machine theory MySQLGroup Communication System(GCS) isbased on Paxos Mencius GR allows to write on all Group Members (cluster nodes) simultaneously while retaining consistency GR implements conflict detection and resolution GR allows automatic distributed recovery Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 64 / 139
  • 65. MySQL Group Replication but what is it ?!? GR is a plugin forMySQL, made byMySQLand packaged withMySQL GR is an implementation of Replicated Database State Machine theory MySQLGroup Communication System(GCS) isbased on Paxos Mencius GR allows to write on all Group Members (cluster nodes) simultaneously while retaining consistency GR implements conflict detection and resolution GR allows automatic distributed recovery Supported onallMySQLplatforms!! Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 65 / 139
  • 66. MySQL Group Replication but what is it ?!? GR is a plugin forMySQL, made byMySQLand packaged withMySQL GR is an implementation of Replicated Database State Machine theory MySQLGroup Communication System(GCS) isbased on Paxos Mencius GR allows to write on all Group Members (cluster nodes) simultaneously while retaining consistency GR implements conflict detection and resolution GR allows automatic distributed recovery Supported onallMySQLplatforms!! Linux, Windows, Solaris, OSX,FreeBSD Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 66 / 139
  • 67. And for users ? Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 67 / 139
  • 68. And for users ? no longer necessary to handleserver fail-over manually or with a complicated script Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 68 / 139
  • 69. And for users ? no longer necessary to handleserver fail-over manually or with a complicated script GR provides fault tolerance Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 69 / 139
  • 70. And for users ? no longer necessary to handleserver fail-over manually or with a complicated script GR provides fault tolerance GR enables update-everywhere setups Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 70 / 139
  • 71. And for users ? no longer necessary to handleserver fail-over manually or with a complicated script GR provides fault tolerance GR enables update-everywhere setups GR handles crashes, failures, re-connetcs automatically Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 71 / 139
  • 72. And for users ? no longer necessary to handleserver fail-over manually or with a complicated script GR provides fault tolerance GR enables update-everywhere setups GR handles crashes, failures, re-connetcs automatically Allows an easy setup of aMySQLservice high available ! Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 72 / 139
  • 73. OK, but how does it work ? Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 73 / 139
  • 74. OK, but how does it work ? it's just ... Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 74 / 139
  • 75. OK, but how does it work ? it's just ... Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 75 / 139
  • 76. OK, but how does it work ? it's just ... ... no, in fact the writesets replication issynchronousand then certification and apply of the changes are local to each nodes and asynchronous. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 76 / 139
  • 77. OK, but how does it work ? it's just ... ... no, in fact the writesets replication issynchronousand then certification and apply of the changes are local to each nodes and asynchronous. not that easy to understand... right ? As a picture isworth a 1000words, let's illustrate this... Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 77 / 139
  • 78. MySQLGroup Replication Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 78 / 139
  • 79. MySQLGroup Replication Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 79 / 139
  • 80. MySQLGroup Replication Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 80 / 139
  • 81. MySQLGroup Replication Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 81 / 139
  • 82. MySQLGroup Replication Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 82 / 139
  • 83. MySQLGroup Replication Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 83 / 139
  • 84. MySQLGroup Replication Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 84 / 139
  • 85. MySQLGroup Replication Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 85 / 139
  • 86. MySQLGroup Replication Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 86 / 139
  • 87. MySQLGroup Replication Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 87 / 139
  • 88. MySQLGroup Replication Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 88 / 139
  • 89. MySQLGroup Replication Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 89 / 139
  • 90. Certification Certification is the process that only needs to answer thefollowing unique question: Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 90 / 139
  • 91. Certification Certification is the process that only needs to answer thefollowing unique question: can the write (transaction) beapplied? Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 91 / 139
  • 92. Certification Certification is the process that only needs to answer thefollowing unique question: can the write (transaction) beapplied? based on unapplied earlier transactions Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 92 / 139
  • 93. Certification Certification is the process that only needs to answer thefollowing unique question: can the write (transaction) beapplied? based on unapplied earlier transactions such conflicts must come forother members/nodes Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 93 / 139
  • 94. Certification Certification is the process that only needs to answer thefollowing unique question: can the write (transaction) beapplied? based on unapplied earlier transactions such conflicts must come forother members/nodes happens on every member/node Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 94 / 139
  • 95. Certification Certification is the process that only needs to answer thefollowing unique question: can the write (transaction) beapplied? based on unapplied earlier transactions such conflicts must come forother members/nodes happens on every member/node should be deterministic on every node Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 95 / 139
  • 96. Certification Certification is the process that only needs to answer thefollowing unique question: can the write (transaction) beapplied? based on unapplied earlier transactions such conflicts must come forother members/nodes happens on every member/node should be deterministic on every node results are not reported to thegroup Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 96 / 139
  • 97. Certification Certification is the process that only needs to answer thefollowing unique question: can the write (transaction) beapplied? based on unapplied earlier transactions such conflicts must come forother members/nodes happens on every member/node should be deterministic on every node results are not reported to thegroup pass: enter in the apply queue Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 97 / 139
  • 98. Certification Certification is the process that only needs to answer thefollowing unique question: can the write (transaction) beapplied? based on unapplied earlier transactions such conflicts must come forother members/nodes happens on every member/node should be deterministic on every node results are not reported to thegroup pass: enter in the apply queue fail: drop the transaction Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 98 / 139
  • 99. Certification Certification is the process that only needs to answer thefollowing unique question: can the write (transaction) beapplied? based on unapplied earlier transactions such conflicts must come forother members/nodes happens on every member/node should be deterministic on every node results are not reported to thegroup pass: enter in the apply queue fail: drop the transaction serialized by the total order in GCS/XCOM+ GTID Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 99 / 139
  • 100. Certification Certification is the process that only needs to answer thefollowing unique question: can the write (transaction) beapplied? based on unapplied earlier transactions such conflicts must come forother members/nodes happens on every member/node should be deterministic on every node results are not reported to thegroup pass: enter in the apply queue fail: drop the transaction serialized by the total order in GCS/XCOM+ GTID cost is based on trx size (# rows &# keys) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 100 / 139
  • 101. GTID GTIDs are the same as those used by asynchronous replication. mysql> SELECT * FROM performance_schema.replication_connection_statusG ************************** 1. row *************************** CHANNEL_NAME: group_replication_applier GROUP_NAME: afb80f36-2bff-11e6-84e0-0800277dd3bf SOURCE_UUID: afb80f36-2bff-11e6-84e0-0800277dd3bf THREAD_ID: NULL SERVICE_STATE: ON COUNT_RECEIVED_HEARTBEATS: 0 LAST_HEARTBEAT_TIMESTAMP: 0000-00-00 00:00:00 RECEIVED_TRANSACTION_SET: afb80f36-2bff-11e6-84e0-0800277dd3bf:1-57, f037578b-46b1-11e6-8005-08002774c31b:1-48937 LAST_ERROR_NUMBER: 0 LAST_ERROR_MESSAGE: LAST_ERROR_TIMESTAMP: 0000-00-00 00:00:00 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 101 / 139
  • 102. but transactions use the Group´s GTID mysql> show master statusG ************************** 1. row *************************** File: mysql4-bin.000001 Position: 1501 Binlog_Do_DB: Binlog_Ignore_DB: Executed_Gtid_Set: afb80f36-2bff-11e6-84e0-0800277dd3bf:1-57, f037578b-46b1-11e6-8005-08002774c31b:1-48937 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 102 / 139
  • 103. Requirements exclusively works with InnoDBtables only Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 103 / 139
  • 104. Requirements exclusively works with InnoDBtables only every tables must have a PK defined Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 104 / 139
  • 105. Requirements exclusively works with InnoDBtables only every tables must have a PK defined only IPV4 is supported Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 105 / 139
  • 106. Requirements exclusively works with InnoDBtables only every tables must have a PK defined only IPV4 is supported a good network with low latency isimportant Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 106 / 139
  • 107. Requirements exclusively works with InnoDBtables only every tables must have a PK defined only IPV4 is supported a good network with low latency isimportant maximum of 9 members per group Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 107 / 139
  • 108. Requirements exclusively works with InnoDBtables only every tables must have a PK defined only IPV4 is supported a good network with low latency isimportant maximum of 9 members per group log-bin must be enabled and onlyROWformat is supported Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 108 / 139
  • 109. Requirements (2) enable GTIDs Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 109 / 139
  • 110. Requirements (2) enable GTIDs replication meta-data must bestored insystem tables --master-info-repository=TABLE --relay-log-info-repository=TABLE Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 110 / 139
  • 111. Requirements (2) enable GTIDs replication meta-data must bestored insystem tables --master-info-repository=TABLE --relay-log-info-repository=TABLE writesets extraction must be enabled --transaction-write-set-extraction=XXHASH64 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 111 / 139
  • 112. Requirements (2) enable GTIDs replication meta-data must bestored insystem tables --master-info-repository=TABLE --relay-log-info-repository=TABLE writesets extraction must be enabled --transaction-write-set-extraction=XXHASH64 log-slave-updates must alsobe enabled Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 112 / 139
  • 113. Limitations binlog checksum is not supported (but we have checksum in the replicationchannel) --binlog-checksum=NONE Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 113 / 139
  • 114. Limitations binlog checksum is not supported (but we have checksum in the replicationchannel) --binlog-checksum=NONE savepointswere not supported before 5.7.19& 8.0.1 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 114 / 139
  • 115. Limitations binlog checksum is not supported (but we have checksum in the replicationchannel) --binlog-checksum=NONE savepointswere not supported before 5.7.19& 8.0.1 SERIALIZABLEis not supported as transaction isolation level Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 115 / 139
  • 116. Limitations binlog checksum is not supported (but we have checksum in the replicationchannel) --binlog-checksum=NONE savepointswere not supported before 5.7.19& 8.0.1 SERIALIZABLEis not supported as transaction isolation level http://lefred.be/content/mysql-group-replication-limitations-savepoints/ http://lefred.be/content/mysql-group-replication-and-table-design/ Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 116 / 139
  • 117. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 117 / 139
  • 118. MySQL Router (GA!) MySQLRouter is lightweight middleware that provides transparent routing between your application and backendMySQLServers. It can be used for awide variety of use cases, such as providing high availability and scalability by effectively routing database trafficto appropriate backendMySQLServers. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 118 / 139
  • 119. MySQL Router (GA!) MySQLRouter is lightweight middleware that provides transparent routing between your application and backendMySQLServers. It can be used for awide variety of use cases, such as providing high availability and scalability by effectively routing database trafficto appropriate backendMySQLServers. MySQLRouter doesn´t require any specific configuration. Itconfigures itself automatically (bootstrap) usingMySQLInnoDB Cluster´s metadata. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 119 / 139
  • 120. MySQL Router (GA!) MySQLRouter is lightweight middleware that provides transparent routing between your application and backendMySQLServers. It can be used for awide variety of use cases, such as providing high availability and scalability by effectively routing database trafficto appropriate backendMySQLServers. MySQLRouter doesn´t require any specific configuration. Itconfigures itself automatically (bootstrap) usingMySQLInnoDB Cluster´s metadata. TheMySQLRouter development will be focusing on sharding. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 120 / 139
  • 121. ProxySQLhas native support for Group Replication which makes it a good choice for advanced users. ProxySQL If you need some specific features that are not yet available inMySQLRouter, like transparent R/W splitting, then you canuse your software of choice. We are also collaborating with ProxySQL. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 121 / 139
  • 122. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 122 / 139
  • 123. MySQL Shell (GA!) TheMySQLShell is an interactive Javascript, Python, or SQLinterface supporting development and administration for theMySQLServer and is acomponent of theMySQL Server. You can use theMySQLShell to perform data queriesand updates aswell as various administration operations. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 123 / 139
  • 124. MySQL Shell (2) TheMySQLShell provides: Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 124 / 139
  • 125. MySQL Shell (2) TheMySQLShell provides: Both Interactive and Batch operations Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 125 / 139
  • 126. MySQL Shell (2) TheMySQLShell provides: Both Interactive and Batch operations Document and Relational Models Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 126 / 139
  • 127. MySQL Shell (2) TheMySQLShell provides: Both Interactive and Batch operations Document and Relational Models CRUD Document and Relational APIs via scripting Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 127 / 139
  • 128. MySQL Shell (2) TheMySQLShell provides: Both Interactive and Batch operations Document and Relational Models CRUD Document and Relational APIs via scripting Traditional Table, JSON, Tab Separated output results formats Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 128 / 139
  • 129. MySQL Shell (2) TheMySQLShell provides: Both Interactive and Batch operations Document and Relational Models CRUD Document and Relational APIs via scripting Traditional Table, JSON, Tab Separated output results formats MySQLStandard and X Protocols Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 129 / 139
  • 130. MySQL Shell (2) TheMySQLShell provides: Both Interactive and Batch operations Document and Relational Models CRUD Document and Relational APIs via scripting Traditional Table, JSON, Tab Separated output results formats MySQLStandard and X Protocols and more... Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 130 / 139
  • 131. MySQL Shell (3) PREVIEW: the new Shell´s prompt is nice and clear ! Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 131 / 139
  • 132. don´t forget, this is a HA solution ! Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 132 / 139
  • 133. Deploying a MySQL using MySQL Shell´s adminAPI: mysql-js> var i1 = 'root@instance01.boston:3306'; mysql-js> var i2 = 'root@instance02.boston:3306'; mysql-js> var i3 = 'root@instance03.boston:3306'; mysql-js> dba.checkInstanceCon guration(i1); mysql-js> dba.checkInstanceCon guration(i2); mysql-js> dba.checkInstanceCon guration(i3); mysql-js> shell.connect(i1); mysql-js> var cluster = dba.createCluster('BostonMUG'); mysql-js> cluster.checkInstanceState(i2); mysql-js> cluster.addInstance(i2); mysql-js> cluster.checkInstanceState(i3); mysql-js> cluster.addInstance(i3); Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 133 / 139
  • 134. Demo https://www.youtube.com/watch?v=gqKdw4QzbzE Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 134 / 139
  • 135. instance01.yaml : classes: - innodbcluster innodbcluster::mysql_serverid: 1 Thanks to the shell we can automate everything ;-) https://github.com/lefred/puppet-lefred-innodbcluster Super easy using hiera: common.yaml: innodbcluster::mysql_root_password: StRongP4ssw0rD! innodbcluster::mysql_bind_interface: eth1 innodbcluster::cluster_name: BostonMUG innodbcluster::grant::user: fred innodbcluster::grant::password: fred innodbcluster::seed: instance01.boston Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 135 / 139
  • 136. example (2) Withhiera-eyaml you can even encrypt your password: innodbcluster::mysql_root_password: > ENC[PKCS7,MIIBeQYJKoZIhvcNAQcDoIIBajCCAWYCAQAxggEhMIIBHQIBADAFMAACAQEw DQYJKoZIhvcNAQEBBQAEggEAhqKUTXZ/4L8/aL3XARMfDBEI+s5HPshPg9BI ... FLfovstrb8zmcbk5yb/KD0lDM8Elas0lrnpk8MxwNfKw+hB299JFp8ldAtUk ODIieTA8BgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBBJEeoyzHtW/WGpbiUz gcXTgBAnb1gGrBZAfAiv/ztwuZ9z] innodbcluster::mysql_bind_interface: eth1 innodbcluster::cluster_name: BostonMUG innodbcluster::grant::user: root innodbcluster::grant::password: > ENC[PKCS7,MIIBeQYJKoZIhvcNAQcDoIIBajCCAWYCAQAxggEhMIIBHQIBADAFMAACAQEw DQYJKoZIhvcNAQEBBQAEggEAhqKUTXZ/4L8/aL3XARMfDBEI+s5HPshPg9BI ... FLfovstrb8zmcbk5yb/KD0lDM8Elas0lrnpk8MxwNfKw+hB299JFp8ldAtUk ODIieTA8BgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBBJEeoyzHtW/WGpbiUz gcXTgBAnb1gGrBZAfAiv/ztwuZ9z] Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 136 / 139
  • 137. Demo ! https://www.youtube.com/watch?v=skwlmBNE7ts Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 137 / 139
  • 139. Thank you ! Any Questions ? Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 139 / 139