SlideShare a Scribd company logo
1
MySQL HA Solution - Percona Cluster
Agenda
• Need for HA
• Principle of Distributed computing.
• MySQL HA Solutions Available.
• Introduction to Galera.
• Percona Cluster.
• Node Recovery.
• Things to be considered.
2
3
• Senior MySQL DBA Yahoo!
• Focus MySQL HA and Sharding
• MySQL Experience 4 Years
• Student MS ( FOSS ) MIT
• Blogger remotemysqldba.blogspot.in
About Myself : P.R.KarthiK
Need For HA
• Site Reliability
• Failover
• Disaster Recovery
• Scheduled / Unscheduled downtime.
• Avoid Single Point Failure
4
Principle of Distributed
Computing
CAP Theorem
5
Principle of Distributed
Computing
CAP Theorem
•Only Two out of three
AP – MySQL Replication
CA – Galera Cluster
6
MySQL HA Solutions Available
• Master – Slave
• Master – Master
• Single Writer
• NDB Cluster ( MySQL )
• Galera Cluster
• Tungsten Replicator
• Storage Level Replication ( DRDB)
7
Introduction To Galera
• Founded By Codership
• Synchronous Replication
• Parallel Replication
• Multi-Threaded
• Automated node recovery
• Zero slave lag
• Read/ Write Scalable
• WAN Based Optimization.
• A True Open Source.
8
Introduction To Galera
What is Galera ?
Galera is a replication plugin for the synchronous and
multi-master replication to achieve HA.
“Wsrep_provider_options” controls library.
Percona Cluster
MariaDB Cluster
Used over MySQL
9
Introduction To Galera
• Shared nothing Architecture.
• Network is the heart.
What is wsrep ? (Write Set REPlication )
It is an API to connect the Galera library and control
characteristics. It helps to implement synchronous
replication and certification based multi-master-
replication.
10
Introduction To Galera
Simple Architecture
11
Percona Cluster
• Use Galera Library
• XtraDB
• Xtrabackup
+ +
12
Percona Cluster
Why Percona Server ?
•Enhanced InnoDB (XtraDB )
•Performance Improvement
•Xtrabackup ( Makes SST better )
•A better MySQL
13
Transaction in Galera.
• Transaction is handled by Galera Plugin.
• Uses traditional dual phase commit.
• It also handles locking.
• Uses the optimistic locking method.
• The commits are based on certifications (keys).
• Smaller transaction are always better.
• Increase in network latency increases query time.
14
Transaction in Galera.
15
Transaction in Galera.
• Synchronous ( Virtual ) Replication.
• Wsrep_causal_reads=ON ( true synchronous)
• Auto_increment is handled by cluster.
• Uses GTID for Transaction.
16
Node Recovery
17
• Node recovery is automated.
• Validates the gcache for state files.
• Chooses the State Transfer method
1) IST (Incremental State Transfer)
2)SST (State Snapshot Transfer )
Node Recovery
18
IST :
•Recover from write sets in gcache.
•Faster recovery method.
•Have good gcache size.
Node Recovery
19
SST :
State Snapshot Transfer the complete transfer
( Cloning ) of data to recreate a node.
*when not in Gcache
*Adding a new node
Different Methods of SST
Xtrabackup (best ) , rsync , mysqldump .
Node Recovery
20
Validate Node after recovery
Wsrep_local_state_Comment
1)Joining
2)Donor/desynced
3)Joined
4)Synced
Things should be considered.
21
• Support only Transactional engines.
• Row Based replication.
• Read commited Isolation.
• Innodb_autoinc_lock_mode=2.
• Avoid huge transactions.
• Wsrep_max_ws_rows (128K)
• Wsrep_max_ws_size. (1G)
• Network is the heart.
• Keep the DB design simple
IMAGE Courtesy
•Galera and Percona cluster documentation
•http://opentodo.net/2012/12/mysql-multi-master-
replication-with-galera/
22
Queries ?
remotemysqldba.blogspot.in
23

More Related Content

PDF
Modern MySQL Monitoring and Dashboards.
PPTX
Ansible for large scale deployment
PDF
Galera cluster for high availability
PDF
Mysql User Camp : 20th June - Mysql New Features
PPTX
MariaDB Galera Cluster
PPTX
High performance and high availability proxies for MySQL
PDF
MySQL Query Optimization (Basics)
PPT
Scaling MySQL using Fabric
Modern MySQL Monitoring and Dashboards.
Ansible for large scale deployment
Galera cluster for high availability
Mysql User Camp : 20th June - Mysql New Features
MariaDB Galera Cluster
High performance and high availability proxies for MySQL
MySQL Query Optimization (Basics)
Scaling MySQL using Fabric

What's hot (19)

PPTX
ProxySQL for MySQL
PDF
ProxySQL - High Performance and HA Proxy for MySQL
PPTX
Maria DB Galera Cluster for High Availability
PDF
Mysql User Camp : 20-June-14 : Mysql Fabric
PDF
MySQL High Availability Solutions
PDF
MySQL Shell for Database Engineers
PDF
Percona XtraDB Cluster ( Ensure high Availability )
PDF
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
PDF
Evolution of DBA in the Cloud Era
PDF
State transfer With Galera
PPTX
Migrating from InnoDB and HBase to MyRocks at Facebook
PDF
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
PDF
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
PPTX
Proxysql use case scenarios plam 2016
PPTX
How to upgrade like a boss to my sql 8.0?
PDF
Best practices for MySQL/MariaDB Server/Percona Server High Availability
PDF
Proxysql ha plam_2016_2_keynote
PDF
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #7: ClusterControl
PDF
Technical Introduction to PostgreSQL and PPAS
ProxySQL for MySQL
ProxySQL - High Performance and HA Proxy for MySQL
Maria DB Galera Cluster for High Availability
Mysql User Camp : 20-June-14 : Mysql Fabric
MySQL High Availability Solutions
MySQL Shell for Database Engineers
Percona XtraDB Cluster ( Ensure high Availability )
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
Evolution of DBA in the Cloud Era
State transfer With Galera
Migrating from InnoDB and HBase to MyRocks at Facebook
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Proxysql use case scenarios plam 2016
How to upgrade like a boss to my sql 8.0?
Best practices for MySQL/MariaDB Server/Percona Server High Availability
Proxysql ha plam_2016_2_keynote
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #7: ClusterControl
Technical Introduction to PostgreSQL and PPAS
Ad

Similar to MySQL HA Percona cluster @ MySQL meetup Mumbai (20)

PDF
The MySQL High Availability Landscape and where Galera Cluster fits in
PDF
Choosing a MySQL High Availability Solution.pdf
PDF
Oss4b - pxc introduction
PPTX
Choosing between Codership's MySQL Galera, MariaDB Galera Cluster and Percona...
PDF
Percona XtraDB Cluster - Small Presentation
PDF
Galera Cluster 4 for MySQL 8 Release Webinar slides
PPTX
Migrating to XtraDB Cluster
PPTX
Migrating to XtraDB Cluster
PDF
MySQL Galera 集群
PDF
Percona XtraDB 集群文档
PPTX
Galera Mysql
PDF
M|18 Under the Hood: Galera Cluster
PDF
Galera Cluster 4 presentation at Percona Live Austin 2019
PDF
Robust ha solutions with proxysql
PDF
What’s new in Galera 4
PPTX
Percona XtraDB Cluster SF Meetup
PDF
2014 OSDC Talk: Introduction to Percona XtraDB Cluster and HAProxy
PDF
9 DevOps Tips for Going in Production with Galera Cluster for MySQL - Slides
PDF
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
PPTX
Overview of some popular distributed databases
The MySQL High Availability Landscape and where Galera Cluster fits in
Choosing a MySQL High Availability Solution.pdf
Oss4b - pxc introduction
Choosing between Codership's MySQL Galera, MariaDB Galera Cluster and Percona...
Percona XtraDB Cluster - Small Presentation
Galera Cluster 4 for MySQL 8 Release Webinar slides
Migrating to XtraDB Cluster
Migrating to XtraDB Cluster
MySQL Galera 集群
Percona XtraDB 集群文档
Galera Mysql
M|18 Under the Hood: Galera Cluster
Galera Cluster 4 presentation at Percona Live Austin 2019
Robust ha solutions with proxysql
What’s new in Galera 4
Percona XtraDB Cluster SF Meetup
2014 OSDC Talk: Introduction to Percona XtraDB Cluster and HAProxy
9 DevOps Tips for Going in Production with Galera Cluster for MySQL - Slides
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
Overview of some popular distributed databases
Ad

More from Remote MySQL DBA (6)

PPTX
Ansible for large scale deployment
PPT
Scaling MySQL Using Fabric
PPTX
Percona tool kit for MySQL DBA's
PDF
MySQL Query Optimization.
PDF
MySQL Storage Engines Basics.
PPT
Mysql from a DBA Prespective
Ansible for large scale deployment
Scaling MySQL Using Fabric
Percona tool kit for MySQL DBA's
MySQL Query Optimization.
MySQL Storage Engines Basics.
Mysql from a DBA Prespective

Recently uploaded (20)

PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPT
Teaching material agriculture food technology
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
A Presentation on Artificial Intelligence
PDF
Modernizing your data center with Dell and AMD
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Cloud computing and distributed systems.
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Network Security Unit 5.pdf for BCA BBA.
“AI and Expert System Decision Support & Business Intelligence Systems”
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Teaching material agriculture food technology
MYSQL Presentation for SQL database connectivity
Per capita expenditure prediction using model stacking based on satellite ima...
NewMind AI Monthly Chronicles - July 2025
A Presentation on Artificial Intelligence
Modernizing your data center with Dell and AMD
Spectral efficient network and resource selection model in 5G networks
Mobile App Security Testing_ A Comprehensive Guide.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Building Integrated photovoltaic BIPV_UPV.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Cloud computing and distributed systems.
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
NewMind AI Weekly Chronicles - August'25 Week I
Understanding_Digital_Forensics_Presentation.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Encapsulation_ Review paper, used for researhc scholars
Network Security Unit 5.pdf for BCA BBA.

MySQL HA Percona cluster @ MySQL meetup Mumbai

  • 1. 1 MySQL HA Solution - Percona Cluster
  • 2. Agenda • Need for HA • Principle of Distributed computing. • MySQL HA Solutions Available. • Introduction to Galera. • Percona Cluster. • Node Recovery. • Things to be considered. 2
  • 3. 3 • Senior MySQL DBA Yahoo! • Focus MySQL HA and Sharding • MySQL Experience 4 Years • Student MS ( FOSS ) MIT • Blogger remotemysqldba.blogspot.in About Myself : P.R.KarthiK
  • 4. Need For HA • Site Reliability • Failover • Disaster Recovery • Scheduled / Unscheduled downtime. • Avoid Single Point Failure 4
  • 6. Principle of Distributed Computing CAP Theorem •Only Two out of three AP – MySQL Replication CA – Galera Cluster 6
  • 7. MySQL HA Solutions Available • Master – Slave • Master – Master • Single Writer • NDB Cluster ( MySQL ) • Galera Cluster • Tungsten Replicator • Storage Level Replication ( DRDB) 7
  • 8. Introduction To Galera • Founded By Codership • Synchronous Replication • Parallel Replication • Multi-Threaded • Automated node recovery • Zero slave lag • Read/ Write Scalable • WAN Based Optimization. • A True Open Source. 8
  • 9. Introduction To Galera What is Galera ? Galera is a replication plugin for the synchronous and multi-master replication to achieve HA. “Wsrep_provider_options” controls library. Percona Cluster MariaDB Cluster Used over MySQL 9
  • 10. Introduction To Galera • Shared nothing Architecture. • Network is the heart. What is wsrep ? (Write Set REPlication ) It is an API to connect the Galera library and control characteristics. It helps to implement synchronous replication and certification based multi-master- replication. 10
  • 11. Introduction To Galera Simple Architecture 11
  • 12. Percona Cluster • Use Galera Library • XtraDB • Xtrabackup + + 12
  • 13. Percona Cluster Why Percona Server ? •Enhanced InnoDB (XtraDB ) •Performance Improvement •Xtrabackup ( Makes SST better ) •A better MySQL 13
  • 14. Transaction in Galera. • Transaction is handled by Galera Plugin. • Uses traditional dual phase commit. • It also handles locking. • Uses the optimistic locking method. • The commits are based on certifications (keys). • Smaller transaction are always better. • Increase in network latency increases query time. 14
  • 16. Transaction in Galera. • Synchronous ( Virtual ) Replication. • Wsrep_causal_reads=ON ( true synchronous) • Auto_increment is handled by cluster. • Uses GTID for Transaction. 16
  • 17. Node Recovery 17 • Node recovery is automated. • Validates the gcache for state files. • Chooses the State Transfer method 1) IST (Incremental State Transfer) 2)SST (State Snapshot Transfer )
  • 18. Node Recovery 18 IST : •Recover from write sets in gcache. •Faster recovery method. •Have good gcache size.
  • 19. Node Recovery 19 SST : State Snapshot Transfer the complete transfer ( Cloning ) of data to recreate a node. *when not in Gcache *Adding a new node Different Methods of SST Xtrabackup (best ) , rsync , mysqldump .
  • 20. Node Recovery 20 Validate Node after recovery Wsrep_local_state_Comment 1)Joining 2)Donor/desynced 3)Joined 4)Synced
  • 21. Things should be considered. 21 • Support only Transactional engines. • Row Based replication. • Read commited Isolation. • Innodb_autoinc_lock_mode=2. • Avoid huge transactions. • Wsrep_max_ws_rows (128K) • Wsrep_max_ws_size. (1G) • Network is the heart. • Keep the DB design simple
  • 22. IMAGE Courtesy •Galera and Percona cluster documentation •http://opentodo.net/2012/12/mysql-multi-master- replication-with-galera/ 22