SlideShare a Scribd company logo
1 of 46
Download to read offline
InnoDB Cluster - Tutorial
Kenny Gryp
Principal MySQL Product Manager
Miguel Araújo
MySQL AdminAPI Tech Lead. Software Engineer
1 / 34
2 / 342 / 34
Safe Harbor
The following is intended to outline our general product direction. It is intended for information purpose 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 up in making purchasing decisions. The development, release, timing and pricing of any features or functionality
described for Oracle´s product may change and remains at the sole discretion of Oracle Corporation.
Statement in this presentation relating to Oracle´s future plans, expectations, beliefs, intentions and ptospects are "forward-
looking statements" and are subject to material risks and uncertainties. A detailed discussion of these factors and other
risks that affect our business is contained in Oracle´s Securities and Exchange Commission (SEC) filings, including our
most recent reports on Form 10-K and Form 10-Q under the heading "Risk Factors". These filings are available on the SEC
´s website or on Oracle´s website at http:// www.oracle.com/investor. All information in this presentation is current as of
September 2019 and Oracle undertakes no duty to update any statement in light of new information or future events.
Copyright @ 2019 Oracle and/or its affiliates.
3 / 34
MySQL InnoDB Cluster
"A single product — MySQL — with high availability and scaling features baked in;
providing an integrated end-to-end solution that is easy to use."
Copyright @ 2019 Oracle and/or its affiliates.
4 / 34
MySQL InnoDB Cluster
"A single product — MySQL — with high availability and scaling features baked in;
providing an integrated end-to-end solution that is easy to use."
Copyright @ 2019 Oracle and/or its affiliates.
4 / 34
Components:
MySQL Group Replication
MySQL Shell
MySQL Router
MySQL InnoDB Cluster
"A single product — MySQL — with high availability and scaling features baked in;
providing an integrated end-to-end solution that is easy to use."
Copyright @ 2019 Oracle and/or its affiliates.
4 / 34
One Product: MySQL
All components developed together
Integration of all components
Full stack testing
MySQL InnoDB Cluster - Goals
Copyright @ 2019 Oracle and/or its affiliates.
5 / 34
One Product: MySQL
All components developed together
Integration of all components
Full stack testing
Easy to Use
One client: MySQL Shell
Integrated orchestration
Homogenous servers
MySQL InnoDB Cluster - Goals
Copyright @ 2019 Oracle and/or its affiliates.
5 / 34
One Product: MySQL
All components developed together
Integration of all components
Full stack testing
Easy to Use
One client: MySQL Shell
Integrated orchestration
Homogenous servers
Flexible and Modern - X Protocol
SQL and NoSQL together
Protocol Buffers
Asynchronous API
Developer friendly
MySQL InnoDB Cluster - Goals
Copyright @ 2019 Oracle and/or its affiliates.
5 / 34
MySQL Group Replication
Copyright @ 2019 Oracle and/or its affiliates.
6 / 34
MySQL Group Replication
Copyright @ 2019 Oracle and/or its affiliates.
7 / 34
High Available Distributed MySQL DB
Open Source
Fault tolerance
Automatic failover
Active/Active update anywhere (limits apply)
Automatic membership management
Adding/removing members
Network partitions, failures
Conflict detection and resolution
Prevents data loss
MySQL Group Replication
Copyright @ 2019 Oracle and/or its affiliates.
7 / 34
MySQL Group Replication
Implementation of Replicated Database State Machine
Total Order - Writes
XCOM - Paxos implementation
8.0+: Member provisioning using CLONE plugin.
Configurable Consistency Guarantees
eventual consistency
8.0+: per session & global read/write consistency
Using MySQL replication framework by design
binary logs
relay logs
GTIDs: Global Transaction IDs
Generally Available since MySQL 5.7
Supported on all platforms: linux, windows, solaris, macosx, freebsd
Copyright @ 2019 Oracle and/or its affiliates.
8 / 34
Consistency: No Data Loss (RPO=0)
in event of failure of (primary) member
Split brain prevention (Quorum)
MySQL Group Replication - Use Cases
Copyright @ 2019 Oracle and/or its affiliates.
9 / 34
Consistency: No Data Loss (RPO=0)
in event of failure of (primary) member
Split brain prevention (Quorum)
Highly Available: Automatic Failover
Primary members are automatically elected
Automatic Network Partition handling
MySQL Group Replication - Use Cases
Copyright @ 2019 Oracle and/or its affiliates.
9 / 34
Consistency: No Data Loss (RPO=0)
in event of failure of (primary) member
Split brain prevention (Quorum)
Highly Available: Automatic Failover
Primary members are automatically elected
Automatic Network Partition handling
Read Scaleout
Add/Remove members as needed
Replication Lag handling with Flow Control
Configurable Consistency Levels
Eventual
Full Consistency -- no stale reads
MySQL Group Replication - Use Cases
Copyright @ 2019 Oracle and/or its affiliates.
9 / 34
Consistency: No Data Loss (RPO=0)
in event of failure of (primary) member
Split brain prevention (Quorum)
Highly Available: Automatic Failover
Primary members are automatically elected
Automatic Network Partition handling
Read Scaleout
Add/Remove members as needed
Replication Lag handling with Flow Control
Configurable Consistency Levels
Eventual
Full Consistency -- no stale reads
Active/Active environments
Write to many members at the same time
ordered writes within the group (XCOM)
guaranteed consistency
Good write performance
due to Optimistic Locking
(workload dependent)
MySQL Group Replication - Use Cases
Copyright @ 2019 Oracle and/or its affiliates.
9 / 34
MySQL Shell
Copyright @ 2019 Oracle and/or its affiliates.
10 / 34
Database Administration Interface
"MySQL Shell provides the developer and DBA with a
single intuitive, flexible, and powerful interface for all
MySQL related tasks!"
Open Source
Multi-Language: JavaScript, Python, and SQL
Naturally scriptable
Supports Document and Relational models
Exposes full Development and Admin API
Classic MySQL protocol and X protocol
MySQL Shell
Copyright @ 2019 Oracle and/or its affiliates.
10 / 34
DEMO
MySQL Shell
Starting an application (sysbench)
Create Cluster
Copyright @ 2019 Oracle and/or its affiliates.
11 / 34
MySQL Router
Copyright @ 2019 Oracle and/or its affiliates.
12 / 34
Transparent Access to Database Arch.
"provide transparent routing between your application and
back-end MySQL Servers"
Transparent client connection routing
Load balancing
Application connection failover
Stateless design offers easy HA client routing
Router as part of the application stack
Little to no configuration needed
Native support for InnoDB clusters
Understands Group Replication topology
Utilizes metadata schema on each member
Currently 2 TCP Ports: PRIMARY and NON-PRIMARY
traffic
MySQL Router
Copyright @ 2019 Oracle and/or its affiliates.
12 / 34
DEMO
Install & Use MySQL Router
Router REST Interface
Shell Extensions
Copyright @ 2019 Oracle and/or its affiliates.
13 / 34
MySQL - Node Provisioning with CLONE
added in MySQL 8.0.17
Provision members that have no data
Takes Physical snapshot of data
Using standard MySQL connection (3306)
Built-in the MySQL Server
Fully integrated in MySQL InnoDB Cluster
https://mysqlhighavailability.com/mysql-innodb-cluster-automatic-node-provisioning
https://mysqlhighavailability.com/a-breakthrough-in-usability-automatic-node-provisioning
Copyright @ 2019 Oracle and/or its affiliates.
14 / 34
DEMO
Add third node to the group
Show CLONE
Extended Status
Copyright @ 2019 Oracle and/or its affiliates.
15 / 34
MySQL Group Replication - Communication
Asynchronous Replication
Copyright @ 2019 Oracle and/or its affiliates.
16 / 34
MySQL Group Replication - Communication
Semi Synchronous Replication
Copyright @ 2019 Oracle and/or its affiliates.
17 / 34
MySQL Group Replication - Communication
Group Replication
Copyright @ 2019 Oracle and/or its affiliates.
18 / 34
DEMO
Stop the primary node
Kill the primary node
setInstanceOption & setOption
switch primary member online
Copyright @ 2019 Oracle and/or its affiliates.
19 / 34
MySQL Group Replication - Network Partitions
Copyright @ 2019 Oracle and/or its affiliates.
20 / 34
Quorum based Network Partition Handling
Prevents Split-Brain
Ensure uneven amount of nodes
view of <=50% of total members: Minority
view of >50% of total members: Majority
will accept reads/writes
MySQL Group Replication - Network Partitions
Copyright @ 2019 Oracle and/or its affiliates.
20 / 34
Quorum based Network Partition Handling
Prevents Split-Brain
Ensure uneven amount of nodes
view of <=50% of total members: Minority
view of >50% of total members: Majority
will accept reads/writes
In case of event of loss of majority:
a minority partition can be forced ONLINE
Nodes in minority:
MySQL Router: moves away traffic
Fencing: members become READ_ONLY or
ABORT_SERVER
MySQL Group Replication - Network Partitions
Copyright @ 2019 Oracle and/or its affiliates.
20 / 34
MySQL Group Replication - Network Partitions
Majority
1. wait 5 seconds, then suspect minority is gone
2. expel minority after group_replication_member_expel_timeout seconds
(default 0, immediately) do not put the variable too high, between suspect and expel
members cannot be added/removed
no new leader can be elected
Minority
1. wait 5 seconds before suspecting itself to lost connection to the majority
2. wait group_replication_unreachable_majority_timeout (default 0, forever)
3. when timeout: group_replication_autorejoin_tries (default 0 times)
retries every 5 minutes
4. After group_replication_exit_state_action
READ_ONLY: allow stale reads to be served (latest default)
ABORT_SERVER: Shutdown MySQL
Copyright @ 2019 Oracle and/or its affiliates.
21 / 34
DEMO
Creating Network Partition
Copyright @ 2019 Oracle and/or its affiliates.
22 / 34
EVENTUAL (default)
BEFORE_ON_PRIMARY_FAILOVER
BEFORE
AFTER
BEFORE_AND_AFTER
MySQL Group Replication - Consistency
Default consistency guarantee is EVENTUAL
Write some data on nodeA,
Read same data immediately on nodeB,
data might be there yet... or not yet.
(Writes remain ordered and write consistency is never compromised)
Consistency level is configurable since MySQL 8.0.14 The scope can be SESSION or GLOBAL.
The possible values are:
Copyright @ 2019 Oracle and/or its affiliates.
23 / 34
MySQL Group Replication - Consistency - EVENTUAL
Copyright @ 2019 Oracle and/or its affiliates.
24 / 34
MySQL Group Replication - Consistency - BEFORE
BEFORE READ or WRITE: wait for all trx to be applied
Impact on READ & WRITE: added response time: at least network latency
Copyright @ 2019 Oracle and/or its affiliates.
25 / 34
MySQL Group Replication - Consistency - AFTER
AFTER WRITE: wait for all trx to be applied
Impact on WRITE only: added response time: at least network latency
Copyright @ 2019 Oracle and/or its affiliates.
26 / 34
MySQL Group Replication - Consistency - BEFORE_AND_AFTER
BEFORE READ or WRITE: wait for all trx to be applied
AFTER WRITE: wait for all trx to be applied
Copyright @ 2019 Oracle and/or its affiliates.
27 / 34
DEMO
Change Consistency Levels
member Weights
resetpasswords
logging
Copyright @ 2019 Oracle and/or its affiliates.
28 / 34
MySQL Group Replication - Performance
8.0 has Writeset based parallel replication
used during distributed recovery & Group Replication
non conflicting transactions can be executed in parallel
COMMITs remain ordered
Copyright @ 2019 Oracle and/or its affiliates.
29 / 34
MySQL Group Replication - Performance
Copyright @ 2019 Oracle and/or its affiliates.
30 / 34
MySQL Group Replication - Performance
in default consistency level (EVENTUAL)
expected additional response time is ± network latency between members
only at trx COMMIT
Copyright @ 2019 Oracle and/or its affiliates.
31 / 34
MySQL InnoDB Cluster - Continuously Evolving
Copyright @ 2019 Oracle and/or its affiliates.
32 / 34
Thank you !
Copyright @ 2019 Oracle and/or its affiliates.
33 / 34
Session Survey
Help us make the content even better.
Please complete the session survey in the
Mobile App.
https://dev.mysql.com/
http://www.mysql.com
https://mysqlhighavailability.com/
Copyright @ 2019 Oracle and/or its affiliates.
34 / 34

More Related Content

More from Miguel Araújo

MySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - TutorialMySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - TutorialMiguel Araújo
 
MySQL InnoDB Cluster: Management and Troubleshooting with MySQL Shell
MySQL InnoDB Cluster: Management and Troubleshooting with MySQL ShellMySQL InnoDB Cluster: Management and Troubleshooting with MySQL Shell
MySQL InnoDB Cluster: Management and Troubleshooting with MySQL ShellMiguel Araújo
 
MySQL Shell - A DevOps-engineer day with MySQL’s development and administrati...
MySQL Shell - A DevOps-engineer day with MySQL’s development and administrati...MySQL Shell - A DevOps-engineer day with MySQL’s development and administrati...
MySQL Shell - A DevOps-engineer day with MySQL’s development and administrati...Miguel Araújo
 
MySQL Shell: The DevOps Tool for MySQL
MySQL Shell: The DevOps Tool for MySQLMySQL Shell: The DevOps Tool for MySQL
MySQL Shell: The DevOps Tool for MySQLMiguel Araújo
 
MySQL 8 High Availability with InnoDB Clusters
MySQL 8 High Availability with InnoDB ClustersMySQL 8 High Availability with InnoDB Clusters
MySQL 8 High Availability with InnoDB ClustersMiguel Araújo
 
FOSDEM'18: MySQL InnoDB Cluster - MySQL HA Made Easy!
FOSDEM'18: MySQL InnoDB Cluster - MySQL HA Made Easy!FOSDEM'18: MySQL InnoDB Cluster - MySQL HA Made Easy!
FOSDEM'18: MySQL InnoDB Cluster - MySQL HA Made Easy!Miguel Araújo
 
MySQL Shell - The DevOps Tool for MySQL
MySQL Shell - The DevOps Tool for MySQLMySQL Shell - The DevOps Tool for MySQL
MySQL Shell - The DevOps Tool for MySQLMiguel Araújo
 
MySQL Proxy. A powerful, flexible MySQL toolbox.
MySQL Proxy. A powerful, flexible MySQL toolbox.MySQL Proxy. A powerful, flexible MySQL toolbox.
MySQL Proxy. A powerful, flexible MySQL toolbox.Miguel Araújo
 
SLQ vs NOSQL - friends or foes
SLQ vs NOSQL - friends or foesSLQ vs NOSQL - friends or foes
SLQ vs NOSQL - friends or foesMiguel Araújo
 
Asynchronous Replication of Databases
Asynchronous Replication of DatabasesAsynchronous Replication of Databases
Asynchronous Replication of DatabasesMiguel Araújo
 
Evaluating Data Freshness in Large Scale Replicated Databases
Evaluating Data Freshness in Large Scale Replicated DatabasesEvaluating Data Freshness in Large Scale Replicated Databases
Evaluating Data Freshness in Large Scale Replicated DatabasesMiguel Araújo
 

More from Miguel Araújo (11)

MySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - TutorialMySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - Tutorial
 
MySQL InnoDB Cluster: Management and Troubleshooting with MySQL Shell
MySQL InnoDB Cluster: Management and Troubleshooting with MySQL ShellMySQL InnoDB Cluster: Management and Troubleshooting with MySQL Shell
MySQL InnoDB Cluster: Management and Troubleshooting with MySQL Shell
 
MySQL Shell - A DevOps-engineer day with MySQL’s development and administrati...
MySQL Shell - A DevOps-engineer day with MySQL’s development and administrati...MySQL Shell - A DevOps-engineer day with MySQL’s development and administrati...
MySQL Shell - A DevOps-engineer day with MySQL’s development and administrati...
 
MySQL Shell: The DevOps Tool for MySQL
MySQL Shell: The DevOps Tool for MySQLMySQL Shell: The DevOps Tool for MySQL
MySQL Shell: The DevOps Tool for MySQL
 
MySQL 8 High Availability with InnoDB Clusters
MySQL 8 High Availability with InnoDB ClustersMySQL 8 High Availability with InnoDB Clusters
MySQL 8 High Availability with InnoDB Clusters
 
FOSDEM'18: MySQL InnoDB Cluster - MySQL HA Made Easy!
FOSDEM'18: MySQL InnoDB Cluster - MySQL HA Made Easy!FOSDEM'18: MySQL InnoDB Cluster - MySQL HA Made Easy!
FOSDEM'18: MySQL InnoDB Cluster - MySQL HA Made Easy!
 
MySQL Shell - The DevOps Tool for MySQL
MySQL Shell - The DevOps Tool for MySQLMySQL Shell - The DevOps Tool for MySQL
MySQL Shell - The DevOps Tool for MySQL
 
MySQL Proxy. A powerful, flexible MySQL toolbox.
MySQL Proxy. A powerful, flexible MySQL toolbox.MySQL Proxy. A powerful, flexible MySQL toolbox.
MySQL Proxy. A powerful, flexible MySQL toolbox.
 
SLQ vs NOSQL - friends or foes
SLQ vs NOSQL - friends or foesSLQ vs NOSQL - friends or foes
SLQ vs NOSQL - friends or foes
 
Asynchronous Replication of Databases
Asynchronous Replication of DatabasesAsynchronous Replication of Databases
Asynchronous Replication of Databases
 
Evaluating Data Freshness in Large Scale Replicated Databases
Evaluating Data Freshness in Large Scale Replicated DatabasesEvaluating Data Freshness in Large Scale Replicated Databases
Evaluating Data Freshness in Large Scale Replicated Databases
 

Recently uploaded

WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 

Recently uploaded (20)

WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 

MySQL InnoDB Cluster: High Availability Tutorial

  • 1. InnoDB Cluster - Tutorial Kenny Gryp Principal MySQL Product Manager Miguel Araújo MySQL AdminAPI Tech Lead. Software Engineer 1 / 34
  • 2. 2 / 342 / 34
  • 3. Safe Harbor The following is intended to outline our general product direction. It is intended for information purpose 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 up in making purchasing decisions. The development, release, timing and pricing of any features or functionality described for Oracle´s product may change and remains at the sole discretion of Oracle Corporation. Statement in this presentation relating to Oracle´s future plans, expectations, beliefs, intentions and ptospects are "forward- looking statements" and are subject to material risks and uncertainties. A detailed discussion of these factors and other risks that affect our business is contained in Oracle´s Securities and Exchange Commission (SEC) filings, including our most recent reports on Form 10-K and Form 10-Q under the heading "Risk Factors". These filings are available on the SEC ´s website or on Oracle´s website at http:// www.oracle.com/investor. All information in this presentation is current as of September 2019 and Oracle undertakes no duty to update any statement in light of new information or future events. Copyright @ 2019 Oracle and/or its affiliates. 3 / 34
  • 4. MySQL InnoDB Cluster "A single product — MySQL — with high availability and scaling features baked in; providing an integrated end-to-end solution that is easy to use." Copyright @ 2019 Oracle and/or its affiliates. 4 / 34
  • 5. MySQL InnoDB Cluster "A single product — MySQL — with high availability and scaling features baked in; providing an integrated end-to-end solution that is easy to use." Copyright @ 2019 Oracle and/or its affiliates. 4 / 34
  • 6. Components: MySQL Group Replication MySQL Shell MySQL Router MySQL InnoDB Cluster "A single product — MySQL — with high availability and scaling features baked in; providing an integrated end-to-end solution that is easy to use." Copyright @ 2019 Oracle and/or its affiliates. 4 / 34
  • 7. One Product: MySQL All components developed together Integration of all components Full stack testing MySQL InnoDB Cluster - Goals Copyright @ 2019 Oracle and/or its affiliates. 5 / 34
  • 8. One Product: MySQL All components developed together Integration of all components Full stack testing Easy to Use One client: MySQL Shell Integrated orchestration Homogenous servers MySQL InnoDB Cluster - Goals Copyright @ 2019 Oracle and/or its affiliates. 5 / 34
  • 9. One Product: MySQL All components developed together Integration of all components Full stack testing Easy to Use One client: MySQL Shell Integrated orchestration Homogenous servers Flexible and Modern - X Protocol SQL and NoSQL together Protocol Buffers Asynchronous API Developer friendly MySQL InnoDB Cluster - Goals Copyright @ 2019 Oracle and/or its affiliates. 5 / 34
  • 10. MySQL Group Replication Copyright @ 2019 Oracle and/or its affiliates. 6 / 34
  • 11. MySQL Group Replication Copyright @ 2019 Oracle and/or its affiliates. 7 / 34
  • 12. High Available Distributed MySQL DB Open Source Fault tolerance Automatic failover Active/Active update anywhere (limits apply) Automatic membership management Adding/removing members Network partitions, failures Conflict detection and resolution Prevents data loss MySQL Group Replication Copyright @ 2019 Oracle and/or its affiliates. 7 / 34
  • 13. MySQL Group Replication Implementation of Replicated Database State Machine Total Order - Writes XCOM - Paxos implementation 8.0+: Member provisioning using CLONE plugin. Configurable Consistency Guarantees eventual consistency 8.0+: per session & global read/write consistency Using MySQL replication framework by design binary logs relay logs GTIDs: Global Transaction IDs Generally Available since MySQL 5.7 Supported on all platforms: linux, windows, solaris, macosx, freebsd Copyright @ 2019 Oracle and/or its affiliates. 8 / 34
  • 14. Consistency: No Data Loss (RPO=0) in event of failure of (primary) member Split brain prevention (Quorum) MySQL Group Replication - Use Cases Copyright @ 2019 Oracle and/or its affiliates. 9 / 34
  • 15. Consistency: No Data Loss (RPO=0) in event of failure of (primary) member Split brain prevention (Quorum) Highly Available: Automatic Failover Primary members are automatically elected Automatic Network Partition handling MySQL Group Replication - Use Cases Copyright @ 2019 Oracle and/or its affiliates. 9 / 34
  • 16. Consistency: No Data Loss (RPO=0) in event of failure of (primary) member Split brain prevention (Quorum) Highly Available: Automatic Failover Primary members are automatically elected Automatic Network Partition handling Read Scaleout Add/Remove members as needed Replication Lag handling with Flow Control Configurable Consistency Levels Eventual Full Consistency -- no stale reads MySQL Group Replication - Use Cases Copyright @ 2019 Oracle and/or its affiliates. 9 / 34
  • 17. Consistency: No Data Loss (RPO=0) in event of failure of (primary) member Split brain prevention (Quorum) Highly Available: Automatic Failover Primary members are automatically elected Automatic Network Partition handling Read Scaleout Add/Remove members as needed Replication Lag handling with Flow Control Configurable Consistency Levels Eventual Full Consistency -- no stale reads Active/Active environments Write to many members at the same time ordered writes within the group (XCOM) guaranteed consistency Good write performance due to Optimistic Locking (workload dependent) MySQL Group Replication - Use Cases Copyright @ 2019 Oracle and/or its affiliates. 9 / 34
  • 18. MySQL Shell Copyright @ 2019 Oracle and/or its affiliates. 10 / 34
  • 19. Database Administration Interface "MySQL Shell provides the developer and DBA with a single intuitive, flexible, and powerful interface for all MySQL related tasks!" Open Source Multi-Language: JavaScript, Python, and SQL Naturally scriptable Supports Document and Relational models Exposes full Development and Admin API Classic MySQL protocol and X protocol MySQL Shell Copyright @ 2019 Oracle and/or its affiliates. 10 / 34
  • 20. DEMO MySQL Shell Starting an application (sysbench) Create Cluster Copyright @ 2019 Oracle and/or its affiliates. 11 / 34
  • 21. MySQL Router Copyright @ 2019 Oracle and/or its affiliates. 12 / 34
  • 22. Transparent Access to Database Arch. "provide transparent routing between your application and back-end MySQL Servers" Transparent client connection routing Load balancing Application connection failover Stateless design offers easy HA client routing Router as part of the application stack Little to no configuration needed Native support for InnoDB clusters Understands Group Replication topology Utilizes metadata schema on each member Currently 2 TCP Ports: PRIMARY and NON-PRIMARY traffic MySQL Router Copyright @ 2019 Oracle and/or its affiliates. 12 / 34
  • 23. DEMO Install & Use MySQL Router Router REST Interface Shell Extensions Copyright @ 2019 Oracle and/or its affiliates. 13 / 34
  • 24. MySQL - Node Provisioning with CLONE added in MySQL 8.0.17 Provision members that have no data Takes Physical snapshot of data Using standard MySQL connection (3306) Built-in the MySQL Server Fully integrated in MySQL InnoDB Cluster https://mysqlhighavailability.com/mysql-innodb-cluster-automatic-node-provisioning https://mysqlhighavailability.com/a-breakthrough-in-usability-automatic-node-provisioning Copyright @ 2019 Oracle and/or its affiliates. 14 / 34
  • 25. DEMO Add third node to the group Show CLONE Extended Status Copyright @ 2019 Oracle and/or its affiliates. 15 / 34
  • 26. MySQL Group Replication - Communication Asynchronous Replication Copyright @ 2019 Oracle and/or its affiliates. 16 / 34
  • 27. MySQL Group Replication - Communication Semi Synchronous Replication Copyright @ 2019 Oracle and/or its affiliates. 17 / 34
  • 28. MySQL Group Replication - Communication Group Replication Copyright @ 2019 Oracle and/or its affiliates. 18 / 34
  • 29. DEMO Stop the primary node Kill the primary node setInstanceOption & setOption switch primary member online Copyright @ 2019 Oracle and/or its affiliates. 19 / 34
  • 30. MySQL Group Replication - Network Partitions Copyright @ 2019 Oracle and/or its affiliates. 20 / 34
  • 31. Quorum based Network Partition Handling Prevents Split-Brain Ensure uneven amount of nodes view of <=50% of total members: Minority view of >50% of total members: Majority will accept reads/writes MySQL Group Replication - Network Partitions Copyright @ 2019 Oracle and/or its affiliates. 20 / 34
  • 32. Quorum based Network Partition Handling Prevents Split-Brain Ensure uneven amount of nodes view of <=50% of total members: Minority view of >50% of total members: Majority will accept reads/writes In case of event of loss of majority: a minority partition can be forced ONLINE Nodes in minority: MySQL Router: moves away traffic Fencing: members become READ_ONLY or ABORT_SERVER MySQL Group Replication - Network Partitions Copyright @ 2019 Oracle and/or its affiliates. 20 / 34
  • 33. MySQL Group Replication - Network Partitions Majority 1. wait 5 seconds, then suspect minority is gone 2. expel minority after group_replication_member_expel_timeout seconds (default 0, immediately) do not put the variable too high, between suspect and expel members cannot be added/removed no new leader can be elected Minority 1. wait 5 seconds before suspecting itself to lost connection to the majority 2. wait group_replication_unreachable_majority_timeout (default 0, forever) 3. when timeout: group_replication_autorejoin_tries (default 0 times) retries every 5 minutes 4. After group_replication_exit_state_action READ_ONLY: allow stale reads to be served (latest default) ABORT_SERVER: Shutdown MySQL Copyright @ 2019 Oracle and/or its affiliates. 21 / 34
  • 34. DEMO Creating Network Partition Copyright @ 2019 Oracle and/or its affiliates. 22 / 34
  • 35. EVENTUAL (default) BEFORE_ON_PRIMARY_FAILOVER BEFORE AFTER BEFORE_AND_AFTER MySQL Group Replication - Consistency Default consistency guarantee is EVENTUAL Write some data on nodeA, Read same data immediately on nodeB, data might be there yet... or not yet. (Writes remain ordered and write consistency is never compromised) Consistency level is configurable since MySQL 8.0.14 The scope can be SESSION or GLOBAL. The possible values are: Copyright @ 2019 Oracle and/or its affiliates. 23 / 34
  • 36. MySQL Group Replication - Consistency - EVENTUAL Copyright @ 2019 Oracle and/or its affiliates. 24 / 34
  • 37. MySQL Group Replication - Consistency - BEFORE BEFORE READ or WRITE: wait for all trx to be applied Impact on READ & WRITE: added response time: at least network latency Copyright @ 2019 Oracle and/or its affiliates. 25 / 34
  • 38. MySQL Group Replication - Consistency - AFTER AFTER WRITE: wait for all trx to be applied Impact on WRITE only: added response time: at least network latency Copyright @ 2019 Oracle and/or its affiliates. 26 / 34
  • 39. MySQL Group Replication - Consistency - BEFORE_AND_AFTER BEFORE READ or WRITE: wait for all trx to be applied AFTER WRITE: wait for all trx to be applied Copyright @ 2019 Oracle and/or its affiliates. 27 / 34
  • 40. DEMO Change Consistency Levels member Weights resetpasswords logging Copyright @ 2019 Oracle and/or its affiliates. 28 / 34
  • 41. MySQL Group Replication - Performance 8.0 has Writeset based parallel replication used during distributed recovery & Group Replication non conflicting transactions can be executed in parallel COMMITs remain ordered Copyright @ 2019 Oracle and/or its affiliates. 29 / 34
  • 42. MySQL Group Replication - Performance Copyright @ 2019 Oracle and/or its affiliates. 30 / 34
  • 43. MySQL Group Replication - Performance in default consistency level (EVENTUAL) expected additional response time is ± network latency between members only at trx COMMIT Copyright @ 2019 Oracle and/or its affiliates. 31 / 34
  • 44. MySQL InnoDB Cluster - Continuously Evolving Copyright @ 2019 Oracle and/or its affiliates. 32 / 34
  • 45. Thank you ! Copyright @ 2019 Oracle and/or its affiliates. 33 / 34
  • 46. Session Survey Help us make the content even better. Please complete the session survey in the Mobile App. https://dev.mysql.com/ http://www.mysql.com https://mysqlhighavailability.com/ Copyright @ 2019 Oracle and/or its affiliates. 34 / 34