SlideShare a Scribd company logo
MariaDB	
  Galera	
  Cluster

Simple,	
  Transparent,	
  Highly	
  Available

Ivan	
  Zora?,	
  CTO	
  -­‐	
  13.11.2013
Who	
  is	
  Ivan

?
SkySQL
•Leading	
  provider	
  of	
  open	
  source	
  
databases,	
  services	
  and	
  
solutions

•Home	
  for	
  the	
  founders	
  and	
  the	
  

original	
  developers	
  of	
  the	
  core	
  of	
  
MySQL

•The	
  creators	
  of	
  MariaDB,	
  the	
  

drop-­‐in,	
  innovative	
  replacement	
  
of	
  MySQL
PAGE	
   3
Agenda
•Welcome	
  and	
  intro
•Galera	
  Cluster	
  Short	
  Introduction
•Cluster	
  Topologies
•Automatic	
  Node	
  Joining	
  (SST	
  IST)
•Galera	
  Project
•Galera,	
  MariaDB	
  and	
  SkySQL
PAGE	
   4
Intro	
  to	
  Galera	
  Cluster
Multi-Master Replication

MySQL
Galera Replication
Multi-Master Replication

There can be several nodes

MySQL

MySQL

Galera Replication
Multi-Master Replication

There can be several nodes

MySQL

MySQL

Galera Replication

MySQL

Automatic node provisioning
Multi-Master Replication

Client can connect to any node
There can be several nodes

MySQL

MySQL

Galera Replication

MySQL

Automatic node provisioning
Multi-Master Replication

read & write

read & write

read & write

Read & write access to any node
Client can connect to any node
There can be several nodes

MySQL

MySQL

Galera Replication

MySQL

Automatic node provisioning
Multi-Master Replication

read & write

read & write

read & write

Read & write access to any node
Client can connect to any node
There can be several nodes

MySQL

MySQL

Galera Replication

MySQL

Automatic node provisioning
Replication is synchronous
Multi-Master Replication

read & write

read & write

read & write

Multi-master cluster looks like
one big database with multiple
entry points
MySQL
Synchronous Replication

Transaction is processed
locally up to commit time

Read & write

MySQL

MySQL

Galera Replication

MySQL
Synchronous Replication

Transaction is replicated to
whole cluster

commit

MySQL

MySQL

a
Galera Replication

MySQL
Synchronous Replication

Client gets OK status
OK

MySQL

MySQL

Galera Replication

MySQL
Synchronous Replication

Transaction is applied in
slaves

MySQL

MySQL

Galera Replication

MySQL
How node failures are handled

Load Balancing

MySQL

MySQL

MySQL

Galera Replication
Quorum

Galera uses quorum based failure handling:
–

When cluster partitioning is detected, the
majority partition "has quorum" and can
continue

–

A minority partition cannot commit
transactions, but will attempt to re-connect
to primary partition

–

Load Balancing

Note: 50% is not majority!

=> Minimum 3 nodes recommended.
Load balancer will notice errors & remove node
from pool

MySQL

MySQL

MySQL

Galera Replication
Optimistic Concurrency Control

commit

commit

Trx A

Trx B

A

B

Galera Replication
Optimistic Concurrency Control

●

●

●

Transactions process independently in each cluster
node
Transaction write sets will be replicated at commit time
(before commit)
Cluster wide conflicts will be resolved and conflict victim
must rollback
Optimistic Concurrency Control
Galera vs other HA solutions

Solid

SAN

Galera

RAC

Data integrity

DRBD

Galera is like...

NDB
●

99.999...%

●

MySQL replication without integrity issues
or slave lag
DRBD/SAN without failover downtime and
performance penalty

●

●

Poor

99 %
Slow

MySQL
replication
Failover downtime

Fast

Oracle RAC without failover downtime
NDB, but you get to keep InnoDB
Galera Cluster

➢

Synchronous multi-master cluster

➢

Each node full representative of DB

➢

No Single point of failure

➢

For MySQL+InnoDB
➢

99.99% compatible

➢

3 or more nodes needed for HA

➢

Automatic node provisioning

➢

Works in LAN / WAN / Cloud

No Data Loss
No Slave Lag
No Failover
Cluster	
  Topologies
Cluster Topologies
WAN replication

●

Works fine

●

Use higher timeouts and send windows

●

No impact on reads

●

No impact within a transaction

●

adds 100-300 ms to commit latency

●

No major impact on tps

●

Quorum between data centers
–3

data centers

– Distribute

nodes evenly
WAN with MySQL asynchronous replication

●

●
●

●

●

You can mix Galera replication and
MySQL replication
Good option on poor WAN
Remember to watch out for slave lag,
etc...
"Channel failover" if a master node
crashes
Mixed replication useful when you want
async slave (such as time-delayed,
filtered, multi-source...)
Migrating to Galera Clustering

MySQL
master
MySQL master slave hierarchy

MySQL
slave
Galera as MySQL Slave

MySQL
master
Add Galera node as normal
MySQL slave

MySQL
slave

Galera
Node 1
Galera as MySQL Slave

MySQL
master
Join more nodes in Galera slave cluster

MySQL
slave

Galera
Node 1

Galera
Node 2

Galera
Node 3
Galera as MySQL Slave

MySQL
master
Move traffic to Galera cluster

MySQL
slave

Galera
Node 1

Galera
Node 2

Galera
Node 3
Galera as MySQL Slave

Drop obsolete MySQL servers

Galera
Node 1

Galera
Node 2

Galera
Node 3
Automatic	
  Node	
  Provisioning
State Transfer

Joining node needs to get the current database state
➢
Two choices:
➢
IST: incremental state transfer
➢
SST: full state transfer
➢
If joining node has been part of cluster,
and has some previous state,
and gcache spans to that,
then IST can be used
➢
State Snapshot Transfer
To send full database state
●wsrep_sst_method to choose the method:
➢
mysqldump
➢
rsync
➢
xtrabackup
➢
write your own...
●
The	
  Galera	
  Project
Galera Project
●

Galera Cluster for MySQL
5 years development
● Fully open source
● Based on MySQL Community Server
● Active community
●

●

~3 releases per year
●

●

Latest release 3.0

MariaDB Galera Cluster
Galera Replicator on Launchpad

37
Galera 3.0

• WAN Replication support
•Connections between cluster segments (previously it was between
all the nodes)

•Donors for State Transfer will be searched within the segment first
•Weighted quorum calculation

• Certification Keys refactoring
•Reduced memory footprint
•Faster key checks
•Larger transactions can run in parallel
38
Galera 3.0

• GTID Support
•MySQL Slaves will see Galera

Cluster as one MySQL Master

•Pre-ordered Replication
•MySQL Replication events and

Galera Replication events can
be applied without conflicts

39
Who is using Galera?
Galera Support

Galera
Cluster

MariaDB
Galera
Cluster

SkySQL

Support Subscriptions

Codership
Galera

MontyProgram
MariaDB, MySQL
SkySQL	
  Support,	
  Consulting	
  and	
  Training
•
•

•

The	
  best	
  services	
  and	
  support	
  
from	
  the	
  original	
  developers	
  
of	
  MySQL	
  and	
  Galera
Customized	
  professional	
  
services	
  that	
  adapt	
  to	
  
customers’	
  needs,	
  from	
  the	
  
smallest	
  to	
  the	
  largest	
  
implementations
On	
  site	
  and	
  public	
  training	
  
classes	
  delivered	
  by	
  certified	
  
trainers	
  who	
  have	
  
implemented	
  Galera	
  in	
  many	
  
organizations	
  worldwide
PAGE	
   42
For	
  More	
  Information...
•
•
•
•
•

Information	
  on	
  Galera:
www.galera.com
Web,	
  Doc	
  &	
  Knowledge	
  Base:
www.mariadb.org
www.mariadb.com
Launchpad:
launchpad.net/maria
launchpad.net/galera
Jira	
  (bugs	
  and	
  development):
mariadb.atlassian.net
IRC:
irc.freenode.net	
  #maria
webchat.freenode.net/?
randomnick=1&channels=maria
PAGE	
   43
Thank	
  You!

www.skysql.com

ivan@skysql.com
izoratti.blogspot.com
www.slideshare.net/izoratti

More Related Content

What's hot (20)

PDF
Maxscale_메뉴얼
NeoClova
 
DOCX
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
NeoClova
 
PDF
MariaDB MaxScale monitor 매뉴얼
NeoClova
 
PDF
[2018] MySQL 이중화 진화기
NHN FORWARD
 
PPTX
My sql failover test using orchestrator
YoungHeon (Roy) Kim
 
PDF
MySQL/MariaDB Proxy Software Test
I Goo Lee
 
PPTX
High performance and high availability proxies for MySQL
Mydbops
 
PDF
How to Manage Scale-Out Environments with MariaDB MaxScale
MariaDB plc
 
PPTX
MariaDB High Availability
MariaDB plc
 
PDF
MySQL InnoDB Cluster HA Overview & Demo
Keith Hollman
 
PDF
MyRocks Deep Dive
Yoshinori Matsunobu
 
PPTX
ProxySQL for MySQL
Mydbops
 
PDF
Simplifying Your IT Workflow with Katello and Foreman
Nikhil Kathole
 
PDF
Ceph as software define storage
Mahmoud Shiri Varamini
 
PPTX
Running MariaDB in multiple data centers
MariaDB plc
 
PDF
Introduction to Galera
Henrik Ingo
 
PDF
Demystifying MySQL Replication Crash Safety
Jean-François Gagné
 
PPTX
MariaDB Galera Cluster
Abdul Manaf
 
PPTX
MySQL Monitoring using Prometheus & Grafana
YoungHeon (Roy) Kim
 
PDF
MySQL User Camp: Multi-threaded Slaves
Shivji Kumar Jha
 
Maxscale_메뉴얼
NeoClova
 
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
NeoClova
 
MariaDB MaxScale monitor 매뉴얼
NeoClova
 
[2018] MySQL 이중화 진화기
NHN FORWARD
 
My sql failover test using orchestrator
YoungHeon (Roy) Kim
 
MySQL/MariaDB Proxy Software Test
I Goo Lee
 
High performance and high availability proxies for MySQL
Mydbops
 
How to Manage Scale-Out Environments with MariaDB MaxScale
MariaDB plc
 
MariaDB High Availability
MariaDB plc
 
MySQL InnoDB Cluster HA Overview & Demo
Keith Hollman
 
MyRocks Deep Dive
Yoshinori Matsunobu
 
ProxySQL for MySQL
Mydbops
 
Simplifying Your IT Workflow with Katello and Foreman
Nikhil Kathole
 
Ceph as software define storage
Mahmoud Shiri Varamini
 
Running MariaDB in multiple data centers
MariaDB plc
 
Introduction to Galera
Henrik Ingo
 
Demystifying MySQL Replication Crash Safety
Jean-François Gagné
 
MariaDB Galera Cluster
Abdul Manaf
 
MySQL Monitoring using Prometheus & Grafana
YoungHeon (Roy) Kim
 
MySQL User Camp: Multi-threaded Slaves
Shivji Kumar Jha
 

Similar to MariaDB Galera Cluster - Simple, Transparent, Highly Available (20)

PDF
The MySQL High Availability Landscape and where Galera Cluster fits in
Sakari Keskitalo
 
ODP
Do more with Galera Cluster in your OpenStack cloud
philip_stoev
 
PDF
[@NaukriEngineering] Introduction to Galera cluster
Naukri.com
 
PDF
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Severalnines
 
PPT
Codership's galera cluster installation and quickstart webinar march 2016
Sakari Keskitalo
 
PPT
Codership's galera cluster installation and quickstart webinar march 2016
Codership Oy - Creators of Galera Cluster
 
PPT
Codership's galera cluster installation and quickstart webinar march 2016
Sakari Keskitalo
 
PDF
Highly Available Load Balanced Galera MySql Cluster
Amr Fawzy
 
PPT
Galera webinar migration to galera cluster from my sql async replication
Codership Oy - Creators of Galera Cluster
 
PDF
MySQL Galera 集群
YUCHENG HU
 
PDF
M|18 Under the Hood: Galera Cluster
MariaDB plc
 
PDF
MariaDB Galera Cluster webinar — 2025 Edition.pdf
Sakari Keskitalo
 
PPTX
MySQL Multi-Master Replication
Michael Naumov
 
PPTX
MySQL Multi Master Replication
Moshe Kaplan
 
PDF
OSDC 2016 - MySQL-Server in Teamwork - Replication and Galera Cluster by Jörg...
NETWAYS
 
PPTX
Galera Mysql
Ahmad Saif
 
PDF
Webinar slides: Introducing Galera 3.0 - Now supporting MySQL 5.6
Severalnines
 
PDF
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
NETWAYS
 
PPTX
Choosing between Codership's MySQL Galera, MariaDB Galera Cluster and Percona...
Codership Oy - Creators of Galera Cluster
 
The MySQL High Availability Landscape and where Galera Cluster fits in
Sakari Keskitalo
 
Do more with Galera Cluster in your OpenStack cloud
philip_stoev
 
[@NaukriEngineering] Introduction to Galera cluster
Naukri.com
 
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Severalnines
 
Codership's galera cluster installation and quickstart webinar march 2016
Sakari Keskitalo
 
Codership's galera cluster installation and quickstart webinar march 2016
Codership Oy - Creators of Galera Cluster
 
Codership's galera cluster installation and quickstart webinar march 2016
Sakari Keskitalo
 
Highly Available Load Balanced Galera MySql Cluster
Amr Fawzy
 
Galera webinar migration to galera cluster from my sql async replication
Codership Oy - Creators of Galera Cluster
 
MySQL Galera 集群
YUCHENG HU
 
M|18 Under the Hood: Galera Cluster
MariaDB plc
 
MariaDB Galera Cluster webinar — 2025 Edition.pdf
Sakari Keskitalo
 
MySQL Multi-Master Replication
Michael Naumov
 
MySQL Multi Master Replication
Moshe Kaplan
 
OSDC 2016 - MySQL-Server in Teamwork - Replication and Galera Cluster by Jörg...
NETWAYS
 
Galera Mysql
Ahmad Saif
 
Webinar slides: Introducing Galera 3.0 - Now supporting MySQL 5.6
Severalnines
 
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
NETWAYS
 
Choosing between Codership's MySQL Galera, MariaDB Galera Cluster and Percona...
Codership Oy - Creators of Galera Cluster
 
Ad

More from MariaDB Corporation (20)

PDF
High Performance Drupal with MariaDB
MariaDB Corporation
 
PDF
Webseminar: MariaDB Enterprise und MariaDB Enterprise Cluster
MariaDB Corporation
 
PPTX
MaxScale - The Pluggable Router
MariaDB Corporation
 
PPTX
MariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt
MariaDB Corporation
 
PPTX
Skalierbarkeit mit MariaDB und MaxScale - MariaDB Roadshow Summer 2014 Hambur...
MariaDB Corporation
 
PPTX
Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hambu...
MariaDB Corporation
 
PDF
Automatisierung & Verwaltung von Datenbank - Clustern mit Severalnines - Mari...
MariaDB Corporation
 
PPTX
The New MariaDB Offering: MariaDB 10, MaxScale and More
MariaDB Corporation
 
PPTX
MaxScale - The Pluggibale Router MariaDB Roadshow 2014 Paris
MariaDB Corporation
 
PPTX
MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014 F...
MariaDB Corporation
 
PPTX
High Availability with MariaDB Enterprise
MariaDB Corporation
 
PPTX
MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014
MariaDB Corporation
 
PPTX
Galaxy Big Data with MariaDB
MariaDB Corporation
 
PDF
Automatisation et Gestion de Cluster de Bases de Données MariaDB Roadshow
MariaDB Corporation
 
PDF
Automation and Management of Database Clusters MariaDB Roadshow 2014
MariaDB Corporation
 
PDF
Automation and Management of Database Clusters
MariaDB Corporation
 
PDF
The New MariaDB Offering - MariaDB 10, MaxScale and more
MariaDB Corporation
 
PDF
MaxScale - The Pluggable Router
MariaDB Corporation
 
PDF
High Availability with MariaDB Enterprise
MariaDB Corporation
 
PDF
MariaDB 10 and Beyond
MariaDB Corporation
 
High Performance Drupal with MariaDB
MariaDB Corporation
 
Webseminar: MariaDB Enterprise und MariaDB Enterprise Cluster
MariaDB Corporation
 
MaxScale - The Pluggable Router
MariaDB Corporation
 
MariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt
MariaDB Corporation
 
Skalierbarkeit mit MariaDB und MaxScale - MariaDB Roadshow Summer 2014 Hambur...
MariaDB Corporation
 
Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hambu...
MariaDB Corporation
 
Automatisierung & Verwaltung von Datenbank - Clustern mit Severalnines - Mari...
MariaDB Corporation
 
The New MariaDB Offering: MariaDB 10, MaxScale and More
MariaDB Corporation
 
MaxScale - The Pluggibale Router MariaDB Roadshow 2014 Paris
MariaDB Corporation
 
MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014 F...
MariaDB Corporation
 
High Availability with MariaDB Enterprise
MariaDB Corporation
 
MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014
MariaDB Corporation
 
Galaxy Big Data with MariaDB
MariaDB Corporation
 
Automatisation et Gestion de Cluster de Bases de Données MariaDB Roadshow
MariaDB Corporation
 
Automation and Management of Database Clusters MariaDB Roadshow 2014
MariaDB Corporation
 
Automation and Management of Database Clusters
MariaDB Corporation
 
The New MariaDB Offering - MariaDB 10, MaxScale and more
MariaDB Corporation
 
MaxScale - The Pluggable Router
MariaDB Corporation
 
High Availability with MariaDB Enterprise
MariaDB Corporation
 
MariaDB 10 and Beyond
MariaDB Corporation
 
Ad

Recently uploaded (20)

PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 

MariaDB Galera Cluster - Simple, Transparent, Highly Available

  • 1. MariaDB  Galera  Cluster Simple,  Transparent,  Highly  Available Ivan  Zora?,  CTO  -­‐  13.11.2013
  • 3. SkySQL •Leading  provider  of  open  source   databases,  services  and   solutions •Home  for  the  founders  and  the   original  developers  of  the  core  of   MySQL •The  creators  of  MariaDB,  the   drop-­‐in,  innovative  replacement   of  MySQL PAGE   3
  • 4. Agenda •Welcome  and  intro •Galera  Cluster  Short  Introduction •Cluster  Topologies •Automatic  Node  Joining  (SST  IST) •Galera  Project •Galera,  MariaDB  and  SkySQL PAGE   4
  • 7. Multi-Master Replication There can be several nodes MySQL MySQL Galera Replication
  • 8. Multi-Master Replication There can be several nodes MySQL MySQL Galera Replication MySQL Automatic node provisioning
  • 9. Multi-Master Replication Client can connect to any node There can be several nodes MySQL MySQL Galera Replication MySQL Automatic node provisioning
  • 10. Multi-Master Replication read & write read & write read & write Read & write access to any node Client can connect to any node There can be several nodes MySQL MySQL Galera Replication MySQL Automatic node provisioning
  • 11. Multi-Master Replication read & write read & write read & write Read & write access to any node Client can connect to any node There can be several nodes MySQL MySQL Galera Replication MySQL Automatic node provisioning Replication is synchronous
  • 12. Multi-Master Replication read & write read & write read & write Multi-master cluster looks like one big database with multiple entry points MySQL
  • 13. Synchronous Replication Transaction is processed locally up to commit time Read & write MySQL MySQL Galera Replication MySQL
  • 14. Synchronous Replication Transaction is replicated to whole cluster commit MySQL MySQL a Galera Replication MySQL
  • 15. Synchronous Replication Client gets OK status OK MySQL MySQL Galera Replication MySQL
  • 16. Synchronous Replication Transaction is applied in slaves MySQL MySQL Galera Replication MySQL
  • 17. How node failures are handled Load Balancing MySQL MySQL MySQL Galera Replication
  • 18. Quorum Galera uses quorum based failure handling: – When cluster partitioning is detected, the majority partition "has quorum" and can continue – A minority partition cannot commit transactions, but will attempt to re-connect to primary partition – Load Balancing Note: 50% is not majority! => Minimum 3 nodes recommended. Load balancer will notice errors & remove node from pool MySQL MySQL MySQL Galera Replication
  • 19. Optimistic Concurrency Control commit commit Trx A Trx B A B Galera Replication
  • 20. Optimistic Concurrency Control ● ● ● Transactions process independently in each cluster node Transaction write sets will be replicated at commit time (before commit) Cluster wide conflicts will be resolved and conflict victim must rollback Optimistic Concurrency Control
  • 21. Galera vs other HA solutions Solid SAN Galera RAC Data integrity DRBD Galera is like... NDB ● 99.999...% ● MySQL replication without integrity issues or slave lag DRBD/SAN without failover downtime and performance penalty ● ● Poor 99 % Slow MySQL replication Failover downtime Fast Oracle RAC without failover downtime NDB, but you get to keep InnoDB
  • 22. Galera Cluster ➢ Synchronous multi-master cluster ➢ Each node full representative of DB ➢ No Single point of failure ➢ For MySQL+InnoDB ➢ 99.99% compatible ➢ 3 or more nodes needed for HA ➢ Automatic node provisioning ➢ Works in LAN / WAN / Cloud No Data Loss No Slave Lag No Failover
  • 25. WAN replication ● Works fine ● Use higher timeouts and send windows ● No impact on reads ● No impact within a transaction ● adds 100-300 ms to commit latency ● No major impact on tps ● Quorum between data centers –3 data centers – Distribute nodes evenly
  • 26. WAN with MySQL asynchronous replication ● ● ● ● ● You can mix Galera replication and MySQL replication Good option on poor WAN Remember to watch out for slave lag, etc... "Channel failover" if a master node crashes Mixed replication useful when you want async slave (such as time-delayed, filtered, multi-source...)
  • 27. Migrating to Galera Clustering MySQL master MySQL master slave hierarchy MySQL slave
  • 28. Galera as MySQL Slave MySQL master Add Galera node as normal MySQL slave MySQL slave Galera Node 1
  • 29. Galera as MySQL Slave MySQL master Join more nodes in Galera slave cluster MySQL slave Galera Node 1 Galera Node 2 Galera Node 3
  • 30. Galera as MySQL Slave MySQL master Move traffic to Galera cluster MySQL slave Galera Node 1 Galera Node 2 Galera Node 3
  • 31. Galera as MySQL Slave Drop obsolete MySQL servers Galera Node 1 Galera Node 2 Galera Node 3
  • 33. State Transfer Joining node needs to get the current database state ➢ Two choices: ➢ IST: incremental state transfer ➢ SST: full state transfer ➢ If joining node has been part of cluster, and has some previous state, and gcache spans to that, then IST can be used ➢
  • 34. State Snapshot Transfer To send full database state ●wsrep_sst_method to choose the method: ➢ mysqldump ➢ rsync ➢ xtrabackup ➢ write your own... ●
  • 36. Galera Project ● Galera Cluster for MySQL 5 years development ● Fully open source ● Based on MySQL Community Server ● Active community ● ● ~3 releases per year ● ● Latest release 3.0 MariaDB Galera Cluster
  • 37. Galera Replicator on Launchpad 37
  • 38. Galera 3.0 • WAN Replication support •Connections between cluster segments (previously it was between all the nodes) •Donors for State Transfer will be searched within the segment first •Weighted quorum calculation • Certification Keys refactoring •Reduced memory footprint •Faster key checks •Larger transactions can run in parallel 38
  • 39. Galera 3.0 • GTID Support •MySQL Slaves will see Galera Cluster as one MySQL Master •Pre-ordered Replication •MySQL Replication events and Galera Replication events can be applied without conflicts 39
  • 40. Who is using Galera?
  • 42. SkySQL  Support,  Consulting  and  Training • • • The  best  services  and  support   from  the  original  developers   of  MySQL  and  Galera Customized  professional   services  that  adapt  to   customers’  needs,  from  the   smallest  to  the  largest   implementations On  site  and  public  training   classes  delivered  by  certified   trainers  who  have   implemented  Galera  in  many   organizations  worldwide PAGE   42
  • 43. For  More  Information... • • • • • Information  on  Galera: www.galera.com Web,  Doc  &  Knowledge  Base: www.mariadb.org www.mariadb.com Launchpad: launchpad.net/maria launchpad.net/galera Jira  (bugs  and  development): mariadb.atlassian.net IRC: irc.freenode.net  #maria webchat.freenode.net/? randomnick=1&channels=maria PAGE   43