Event :  AIOUG BANGALORE Chapter Monthly
Date   : 12 Oct 2019
MySQL HA Solutions
Presenter
Karthik P R,
CEO Mydbops
Karthik P R 
MySQL Consultant 
Founder / CEO Mydbops
About Me
Around 9+ Years of experience with MySQL. 
Consulted huge MySQL Farms in India and US 
Ex Yahoo! ( MySQL DBA )
Active MySQL Community Contributor
Tech Speaker 
Founder Mydbops ( 2016 )
Founded in 2016
Grown from a  2 Member team to 30 Members ( 2019) 
Consulting and Services on MySQL / MongoDB
Managed Services for MySQL / MongoDB
20+ Certi ed MySQL DBA 
AWS Partner for databases
300+ Clients and 50+ in Managed services
About Mydbops
Mydbops
Scaling Database Operations
 1 | MySQL an overview
 2 | Role of MySQL in Open Source World
4 |  MySQL Native Replication 
5 | MySQL Cluster Solutions
 6 | MySQL HA Solutions on Cloud
8 | Tools for MySQL HA
3 | High Availability  7 | MySQL Load Balancers and HA 
AGENDA
MySQL High Availability Solutions
MySQL an overview
Journey of Most Famous Open Source Database 
Initial Release May 1995 - MySQL AB
Michael Widenius ( Main Author) 
2008 Sun Microsystem Acquired MySQL AB
2010 Jan Oracle acquired Sun Microsystems 
2010 MariaDB was formed
2015 Oct MySQL 5.7 was released 
2018 Apr MySQL 8 was released
Role of MySQL in Open Source World
Widely used open Source RDBMS
Ranks 2nd in DB engine ranking ( Following Oracle) 
Most widely used service in Cloud
Adopted by top tech companies and many startups
Scales well for most work load
Very strong MySQL Open Source Community  
Popularity grows day by day
Role of MySQL in Open Source World
 1 | MySQL an overview
 2 | Role of MySQL in Open Source World
4 |  MySQL Native Replication 
5 | MySQL Cluster Solutions
 6 | MySQL HA Solutions on Cloud
8 | Tools for MySQL HA
3 | High Availability  7 | MySQL Load Balancers and HA 
AGENDA
MySQL High Availability Solutions
High Availability 
Reduced downtime (Zero downtime in ideal world) 
Ensure system performance ( Latency )
Data consistency across nodes
 HA = Redundancy 
Uptime
PercentilePercentile
TargetTarget
Max DowntimeMax Downtime
( in a Year )( in a Year )
99% 3.65 Days
99.5% 1.83 Days
99.9% 8.76 Hours
99.9% 52.56 Minutes
99.999% 5.25 Minutes
99.9999% 31.5 Minutes
High Availability 
Replication is the common Solution in MySQL
Types of Replication 
Async Replication ( Native Replication )
Sync Replication ( Virtually Synchronous )
MySQL Architecture
 1 | MySQL an overview
 2 | Role of MySQL in Open Source World
4 |  MySQL Native Replication 
5 | MySQL Cluster Solutions
 6 | MySQL HA Solutions on Cloud
8 | Tools for MySQL HA
3 | High Availability  7 | MySQL Load Balancers and HA 
AGENDA
MySQL High Availability Solutions
MySQL  Native Replication Architecture
Native MySQL Replication 
Replication is a most notable feature in MySQL 
Native MySQL Replication is logical replication
Binary logs helps in recording changes 
Replication is Asynchronous 
Scale out more with replication 
Row based replication is available from MySQL 5.1
Binlog Co-ordinates or GTID based replication
Master - Slave Architecture
Master - Master ( Active - Active )
Master - Multi Slave 
Master - Master ( Active - Passive )
Advantages of Native Replication
Simple solution and easy to mange .
GTID can make switch over / Fail over easy. 
Multi threaded (Parallel) Replication can make sync faster.
Much reduced latency comparing to other solutions.
Good Solution for WAN based data replication.
Data Filtering can be done.
Huge transactions are supported.
Most widely adapted solution 
Dis Advantages of Native Replication
There is a data lag always.
Data can drift / Manual override can break replication.
Huge transactions can cause heavy lag.
Need tools for Automatic master promotion
 1 | MySQL an overview
 2 | Role of MySQL in Open Source World
4 |  MySQL Native Replication 
5 | MySQL Cluster Solutions
 6 | MySQL HA Solutions on Cloud
8 | Tools for MySQL HA
3 | High Availability  7 | MySQL Load Balancers and HA 
AGENDA
MySQL High Availability Solutions
MySQL Cluster Solutions
Synchronous Replication
Galera Cluster 
Group Replication 
NDB Cluster
MySQL Cluster Solutions
Synchronous Replication using two phase Commit 
Latency at writes 
Read/Writes from any node
Shared Nothing Architecture
Auto master promotion ( Single Writer mode )
 Ensure data consistency 
Galera Cluster 
Third party Replication Plugin
Codership Maintains the code  
Virtually Synchronous 
 Multi Master Cluster
Zero Slave lag
Quorum has to be maintained 
More stable and proven solution 
Galera Cluster 
Need minimum three nodes
Replication is handled wsrep plugin 
Percona Cluster or MariaDB Cluster (Bundled )
 Auto Node Provision 
ProxySQL / Maxscale integration makes it better
Supports MySQL 5.5,5.6,5.7 and 8.0
MySQL Group Replication
Inbuilt within MySQL
Uses MySQL Binary log for replication
Ease deployment with MySQL Shell
 Auto Node Provision with Clone plugin.
ProxySQL  integration makes it better.
MySQL Router can be used too.
Supports MySQL 5.7 and 8.0
MySQL Group Replication
Supports Single writer mode
GTID and INNODB engine only
Works for OLTP work load.
More stable in MySQL 8.0.
Supports all Platforms ( Windows too)
 1 | MySQL an overview
 2 | Role of MySQL in Open Source World
4 |  MySQL Native Replication 
5 | MySQL Cluster Solutions
 6 | MySQL HA Solutions on Cloud
8 | Tools for MySQL HA
3 | High Availability  7 | MySQL Load Balancers and HA 
AGENDA
MySQL High Availability Solutions
MySQL HA Solution on Cloud ( AWS )
DBaaS ( RDS / Aurora )
RDS MySQL inbuilt Multi AZ 
Aurora MySQL is Amazon Proprietary 
Aurora uses storage based replication 
 Good for read scaling   
Single Master & Multi readers ( Single read end points ).
 Maxscale and ProxySQL integration. 
Aurora Supports only MySQL 5.6 & 5.7
 1 | MySQL an overview
 2 | Role of MySQL in Open Source World
4 |  MySQL Native Replication 
5 | MySQL Cluster Solutions
 6 | MySQL HA Solutions on Cloud
8 | Tools for MySQL HA
3 | High Availability  7 | MySQL Load Balancers and HA 
AGENDA
MySQL High Availability Solutions
MySQL Load Balancers and HA
Database Availability is hard 
Seem less switchover needs Load Balancers.
TCP Load balancers
HAProxy
MySQL Router
SQL aware load Balancers 
ProxySQL
Maxscale  
MySQL Load Balancers and HA
SQL Intelligence helps in 
Master switch ( traffic Route )
Read write Balancing 
Query Rewrites
Query Caching
Query Filtering
Support all Architectures 
 1 | MySQL an overview
 2 | Role of MySQL in Open Source World
4 |  MySQL Native Replication 
5 | MySQL Cluster Solutions
 6 | MySQL HA Solutions on Cloud
8 | Tools for MySQL HA
3 | High Availability  7 | MySQL Load Balancers and HA 
AGENDA
MySQL High Availability Solutions
Tools for MySQL HA
Orchestrator
Helps in MySQL Replication topology handling
Smart node picking
GUI Support ,CLI , API
Created and Maintained by Github Engineers
MySQL MHA
Automated Failover for Native replication 
Made by Yoshinori ( Facebook ) 
DO YOU HAVE ANY QUESTIONS?
THANK YOU!

MySQL High Availability Solutions

  • 1.
    Event :  AIOUGBANGALORE Chapter Monthly Date   : 12 Oct 2019 MySQL HA Solutions Presenter Karthik P R, CEO Mydbops
  • 2.
    Karthik P R  MySQLConsultant  Founder / CEO Mydbops About Me Around 9+ Years of experience with MySQL.  Consulted huge MySQL Farms in India and US  Ex Yahoo! ( MySQL DBA ) Active MySQL Community Contributor Tech Speaker  Founder Mydbops ( 2016 )
  • 3.
    Founded in 2016 Grownfrom a  2 Member team to 30 Members ( 2019)  Consulting and Services on MySQL / MongoDB Managed Services for MySQL / MongoDB 20+ Certi ed MySQL DBA  AWS Partner for databases 300+ Clients and 50+ in Managed services About Mydbops Mydbops Scaling Database Operations
  • 4.
     1 | MySQLan overview  2 | Role of MySQL in Open Source World 4 |  MySQL Native Replication  5 | MySQL Cluster Solutions  6 | MySQL HA Solutions on Cloud 8 | Tools for MySQL HA 3 | High Availability  7 | MySQL Load Balancers and HA  AGENDA MySQL High Availability Solutions
  • 5.
    MySQL an overview Journeyof Most Famous Open Source Database  Initial Release May 1995 - MySQL AB Michael Widenius ( Main Author)  2008 Sun Microsystem Acquired MySQL AB 2010 Jan Oracle acquired Sun Microsystems  2010 MariaDB was formed 2015 Oct MySQL 5.7 was released  2018 Apr MySQL 8 was released
  • 6.
    Role of MySQLin Open Source World Widely used open Source RDBMS Ranks 2nd in DB engine ranking ( Following Oracle)  Most widely used service in Cloud Adopted by top tech companies and many startups Scales well for most work load Very strong MySQL Open Source Community   Popularity grows day by day
  • 7.
    Role of MySQLin Open Source World
  • 8.
     1 | MySQLan overview  2 | Role of MySQL in Open Source World 4 |  MySQL Native Replication  5 | MySQL Cluster Solutions  6 | MySQL HA Solutions on Cloud 8 | Tools for MySQL HA 3 | High Availability  7 | MySQL Load Balancers and HA  AGENDA MySQL High Availability Solutions
  • 9.
    High Availability  Reduced downtime(Zero downtime in ideal world)  Ensure system performance ( Latency ) Data consistency across nodes  HA = Redundancy 
  • 10.
    Uptime PercentilePercentile TargetTarget Max DowntimeMax Downtime (in a Year )( in a Year ) 99% 3.65 Days 99.5% 1.83 Days 99.9% 8.76 Hours 99.9% 52.56 Minutes 99.999% 5.25 Minutes 99.9999% 31.5 Minutes
  • 11.
    High Availability  Replication isthe common Solution in MySQL Types of Replication  Async Replication ( Native Replication ) Sync Replication ( Virtually Synchronous )
  • 12.
  • 13.
     1 | MySQLan overview  2 | Role of MySQL in Open Source World 4 |  MySQL Native Replication  5 | MySQL Cluster Solutions  6 | MySQL HA Solutions on Cloud 8 | Tools for MySQL HA 3 | High Availability  7 | MySQL Load Balancers and HA  AGENDA MySQL High Availability Solutions
  • 14.
  • 15.
    Native MySQL Replication  Replicationis a most notable feature in MySQL  Native MySQL Replication is logical replication Binary logs helps in recording changes  Replication is Asynchronous  Scale out more with replication  Row based replication is available from MySQL 5.1 Binlog Co-ordinates or GTID based replication
  • 16.
    Master - SlaveArchitecture
  • 17.
    Master - Master( Active - Active )
  • 18.
  • 19.
    Master - Master( Active - Passive )
  • 20.
    Advantages of NativeReplication Simple solution and easy to mange . GTID can make switch over / Fail over easy.  Multi threaded (Parallel) Replication can make sync faster. Much reduced latency comparing to other solutions. Good Solution for WAN based data replication. Data Filtering can be done. Huge transactions are supported. Most widely adapted solution 
  • 21.
    Dis Advantages ofNative Replication There is a data lag always. Data can drift / Manual override can break replication. Huge transactions can cause heavy lag. Need tools for Automatic master promotion
  • 22.
     1 | MySQLan overview  2 | Role of MySQL in Open Source World 4 |  MySQL Native Replication  5 | MySQL Cluster Solutions  6 | MySQL HA Solutions on Cloud 8 | Tools for MySQL HA 3 | High Availability  7 | MySQL Load Balancers and HA  AGENDA MySQL High Availability Solutions
  • 23.
    MySQL Cluster Solutions SynchronousReplication Galera Cluster  Group Replication  NDB Cluster
  • 24.
    MySQL Cluster Solutions SynchronousReplication using two phase Commit  Latency at writes  Read/Writes from any node Shared Nothing Architecture Auto master promotion ( Single Writer mode )  Ensure data consistency 
  • 25.
    Galera Cluster  Third partyReplication Plugin Codership Maintains the code   Virtually Synchronous   Multi Master Cluster Zero Slave lag Quorum has to be maintained  More stable and proven solution 
  • 26.
    Galera Cluster  Need minimumthree nodes Replication is handled wsrep plugin  Percona Cluster or MariaDB Cluster (Bundled )  Auto Node Provision  ProxySQL / Maxscale integration makes it better Supports MySQL 5.5,5.6,5.7 and 8.0
  • 27.
    MySQL Group Replication Inbuiltwithin MySQL Uses MySQL Binary log for replication Ease deployment with MySQL Shell  Auto Node Provision with Clone plugin. ProxySQL  integration makes it better. MySQL Router can be used too. Supports MySQL 5.7 and 8.0
  • 28.
    MySQL Group Replication SupportsSingle writer mode GTID and INNODB engine only Works for OLTP work load. More stable in MySQL 8.0. Supports all Platforms ( Windows too)
  • 29.
     1 | MySQLan overview  2 | Role of MySQL in Open Source World 4 |  MySQL Native Replication  5 | MySQL Cluster Solutions  6 | MySQL HA Solutions on Cloud 8 | Tools for MySQL HA 3 | High Availability  7 | MySQL Load Balancers and HA  AGENDA MySQL High Availability Solutions
  • 30.
    MySQL HA Solutionon Cloud ( AWS ) DBaaS ( RDS / Aurora ) RDS MySQL inbuilt Multi AZ  Aurora MySQL is Amazon Proprietary  Aurora uses storage based replication   Good for read scaling    Single Master & Multi readers ( Single read end points ).  Maxscale and ProxySQL integration.  Aurora Supports only MySQL 5.6 & 5.7
  • 31.
     1 | MySQLan overview  2 | Role of MySQL in Open Source World 4 |  MySQL Native Replication  5 | MySQL Cluster Solutions  6 | MySQL HA Solutions on Cloud 8 | Tools for MySQL HA 3 | High Availability  7 | MySQL Load Balancers and HA  AGENDA MySQL High Availability Solutions
  • 32.
    MySQL Load Balancersand HA Database Availability is hard  Seem less switchover needs Load Balancers. TCP Load balancers HAProxy MySQL Router SQL aware load Balancers  ProxySQL Maxscale  
  • 33.
    MySQL Load Balancersand HA SQL Intelligence helps in  Master switch ( traffic Route ) Read write Balancing  Query Rewrites Query Caching Query Filtering Support all Architectures 
  • 34.
     1 | MySQLan overview  2 | Role of MySQL in Open Source World 4 |  MySQL Native Replication  5 | MySQL Cluster Solutions  6 | MySQL HA Solutions on Cloud 8 | Tools for MySQL HA 3 | High Availability  7 | MySQL Load Balancers and HA  AGENDA MySQL High Availability Solutions
  • 35.
    Tools for MySQLHA Orchestrator Helps in MySQL Replication topology handling Smart node picking GUI Support ,CLI , API Created and Maintained by Github Engineers MySQL MHA Automated Failover for Native replication  Made by Yoshinori ( Facebook ) 
  • 36.
    DO YOU HAVEANY QUESTIONS? THANK YOU!