SlideShare a Scribd company logo
Hochverfügbarkeitslösungen
mit MariaDB
Stefan Schmit, Senior Solution Engineer CEUR
MariaDB plc
2
High Availability - HA
High availability
(HA) is a characteristic
of a system which aims
to ensure an agreed
level of operational
performance, usually
uptime, for a higher than
normal period.
https://en.wikipedia.org/wiki/High_availability
https://upload.wikimedia.org/wikipedia/commons/6/69
/RPO_RTO_example_converted.png
3
RPO RTO
Recovery Time Objective
The Recovery Time Objective (RTO) is the targeted
duration of time and a service level within which a
business process must be restored after a disruption in
order to avoid a break in business continuity.
According to business continuity planning methodology,
the RTO is established during the Business Impact
Analysis (BIA) by the owner(s) of the process, including
identifying time frames for alternate or manual
workarounds.
Recovery Point Objective
A Recovery Point Objective (RPO) is the maximum
acceptable interval during which transactional data is
lost from an IT service.
For example, if RPO is measured in minutes, then in
practice, off-site mirrored backups must be continuously
maintained as a daily off-site backup will not suffice.
https://en.wikipedia.org/wiki/Disaster_recovery
MariaDB Solution offering
4
5
Architecture - Single Node
MariaDB
Primary
r/w
Your
Applications Single Node Setup
No failover option
Backup / Restore is key
RPO / RTO define the SLA
6
Architecture - Primary / Replica Setup
MariaDB
Primary
r/w
Your
Applications
Primary / Replica Node Setup
“Manual” failover to Slave
Asynchronous Replication
Semi-synchronous Replication
“Passive” Hardware
Manual failover process defines the SLA
Backup process can run on Slave
MariaDB
Replica
7
Architecture - Primary / Replica Setup
MariaDB
Primary
r/w
Your
Applications
Primary / Replica Node Setup
“Manual” failover to Slave
Asynchronous Replication
Semi-synchronous Replication
Galera Cluster
“Passive” Hardware
Manual failover process defines the SLA
Backup process can run on Slave
MariaDB
Replica
MariaDB
Replica
Architecture for high Availability with MaxScale
MariaDB
Primary
MaxScale
MariaDB
Replica
r/w r
Your
Applications
MariaDB MaxScale is an advanced SQL firewall, proxy, router, and load balancer:
• MaxScale performs automated failover for MariaDB replication.
• MaxScale's ReadWriteSplit router performs query-based load balancing.
• MaxScale's Cache filter can improve SELECT performance by caching and
reusing results.
• MaxScale can filter data via Data Masking, with defined patterns
• MaxScale also helps to avoid downtimes or hick-ups with
- Upgrades and Patches
- adding Nodes
- DoS attacks
- SQL Injection
- Security Violations
MariaDB
Replica
r
Architecture for high Availability in SkySQL
MariaDB
Primary
MaxScale
MariaDB
Replica
r/w r
Your
Applications
Performance Standard
SkySQL Foundation Tier
• Multi-node configurations will deliver a 99.95%
service availability on a per-billing-month basis.
• For example, with this availability target in a 30 day
calendar month the maximum service downtime is 21
minutes and 54 seconds.
SkySQL Power Tier
• Multi-node configurations will deliver a 99.995%
service availability on a per-billing-month basis.
• For example, with this availability target in a 30 day
calendar month the maximum service downtime is 2
minutes and 11 seconds.
Availability
Zone 2
Availability
Zone 1
MariaDB SkySQL SLA
MariaDB MaxScale
Architecture Options
10
Basic HA Architecture
11
MaxScale
MaxScale
1
Active
Primary Replica-1 Replica-2
Replication
● Only one MaxScale
● Single point of failure
● MariaDB Backend HA
Traditional Setup
12
● Prior to MaxScale 2.5, MaxScale HA required manual intervention
● While all the MaxScale nodes can route queries, read write splitting
and other operations, only the “active” MaxScale node (PASSIVE =
false) could perform automatic failovers.
● In case of the “active” MaxScale goes down, one of the remaining
MaxScale nodes needed to be set to “PASSIVE = false” so that
particular node could handle automatic failover.
● This was usually done with the help of third party tools such as
○ keepalived
○ corosync/pacemaker
Typical Recommended Architecture (Traditionally)
13
MaxScale
MaxScale
1
Active
Primary Replica-1
MaxScale
MaxScale
2
Passive
Replica-2
Replication
● Can’t have both MaxScale doing database
Failover
● Must use 3rd Party tools such as KeepaliveD to
control which is the “Active” MaxScale
● Issues for support in case of KeepaliveD failure
● Complex Configuration
● Only One MaxScale can be used for Query
routing
KeepaliveD
Virtual IP
Why “Cooperative Locking”
14
● Starting with MaxScale 2.5, Co-op Locking was introduced
● Multiple MaxScale nodes can work together without the need of any
third party component(s)
● MaxScale nodes will seamlessly decide which is the primary
MaxScale and which is not.
○ This is done by a special locking mechanism.
● Primary MaxScale handles the MariaDB failover.
● Two modes to choose from
○ majority_of_running
○ majority_of_all
cooperative_monitoring_locks (maxscale.cnf)
15
majority_of_running
● Default in SkySQL if the customer goes for dual MaxScale setup.
● MaxScale node that has the maximum number of locks will become the Primary
● In this mode, the total number of “Running” MariaDB nodes are considered excluding the
nodes that are down.
● Locks required are calculated as
○ Round the result up: n_servers/2 + 1
○ “n_servers” is the total number alive servers in the cluster
○ Consider a 3 nodes cluster
■ All 3 nodes are alive: round(3/2+1) = 2
■ 1 Node goes down: round(2/2+1) = 2
■ 2 Nodes goes down: round(1/2+1) = 1
○ This supports more nodes failure while still being able to do automatic MariaDB
failover.
majority_of_running
16
MaxScale
MaxScale
1
Primary Primary
Primary DC DR DC
MaxScale
MaxScale
2
Replica-1
Async Replication
● One nodes go down, the minimum of DB locks required reduced to “2”, it
can be achieved,
● MaxScale 1 is “primary”
● Automatic DB failover remains activated.
majority_of_running
17
MaxScale
MaxScale
1
Primary Primary
Primary DC DR DC
MaxScale
MaxScale
2
Primary
● 2 nodes go down, the minimum of DB locks required reduced to “1” which can
be still achieved.
● MaxScale 1 is still the “primary” MaxScale
● Automatic DB failover remains activated.
majority_of_running
18
MaxScale
MaxScale
1
Primary Primary
Primary DC DR DC
MaxScale
MaxScale
2
● Entire Data Center goes down
● The minimum of DB locks required is
reduced to “1” which can be still achieved.
● MaxScale 3 becomes “primary”
● Automatic DB failover remains activated.
Primary
cooperative_monitoring_locks (maxscale.cnf)
19
majority_of_running
● Can cause split-brain (Multiple MaxScale nodes becoming primary!)
○ Consider a Primary / DR setup
○ In case of a network partition between the two data centers, both
MaxScale on each data center will become “Primary” as they can’t
see the other side DB nodes.
○ This leads to Two “Primary” MariaDB servers running on each data
center!
○ Unlikely scenario but keep this in mind.
majority_of_running
20
MaxScale
MaxScale
1
Primary Replica-1
Primary DC DR DC
MaxScale
MaxScale
2
Primary
● Network between the two data centers is LOST
● The MaxScale nodes can only see the DB nodes within their own data centers
● “majority_of_running” rule applies and minimum of locks required is reduced to 2 for DC and is reduced to 1 for DR
● Split-Brain! We now have two “primary” MaxScale nodes!
● The new “primary” MaxScale node in DR, promotes one of the Replica as “Primary DB”
● Two Primary DB nodes running, one on each DC creating data inconsistency!
Async Replication
cooperative_monitoring_locks (maxscale.cnf)
21
majority_of_all
● In this mode, all the nodes are considered
● MaxScale node that has the maximum number of locks will become the Primary
● Locks required are calculated as
○ Round the result up: n_servers/2 + 1
○ “n_servers” is the total number of MariaDB servers in the cluster
○ In case of
■ 3 nodes setup, the locks required by MaxScale is round(3/2+1) = 2
■ 7 nodes setup, the locks required by MaxScale is round(7/2+1) = 4
● If too many MariaDB nodes going down at the same time, none of the
MaxScale nodes will be able to get the minimum number of locks required.
○ Consider, total of 3 backend servers, if 2 nodes go down, the minimum of
required locks, “2”, can’t be achieved
○ No automatic failover.
○ Minimum of “n_servers/2 + 1” must be alive for the automatic failover to
work
majority_of_all
22
MaxScale
MaxScale
1
Primary Replica-1
Primary DC DR DC
MaxScale
MaxScale
2
Replica-2
Async Replication
● Locks required are (round up of) 3/2+1 = 2
● MaxScale 1 has the max locks for instance, it becomes “primary”
● Other three MaxScale noes are “secondary”
majority_of_all
23
MaxScale
MaxScale
1
Primary Primary
Primary DC DR DC
MaxScale
MaxScale
2
Replica-2
Async Replication
● One nodes go down, the minimum of DB locks required “2” can be achieved,
● MaxScale 1 is still “primary”
● It is possible, another MaxScale node becomes primary, but only one.
majority_of_all
24
MaxScale
MaxScale
1
Primary Primary
Primary DC DR DC
MaxScale
MaxScale
2
Replica-2
● 2 nodes go down, the minimum of DB locks required “2” can no longer be be achieved!
● All the MaxScale nodes become “secondary”, Automatic failover is disabled.
cooperative_monitoring_locks (maxscale.cnf)
25
majority_of_all
● This protects against multiple MaxScale nodes becoming
primary in case of a split brain scenario
● Good to have in case of poor network network between two
data centers.
majority_of_all
26
MaxScale
MaxScale
1
Primary Replica-1
Primary DC DR DC (Read-Only)
MaxScale
MaxScale
2
Replica-2
● Network between the two data centers is broken, all the MaxScale nodes on DC can
acquire 2 locks each which the same as minimum requirement of “2”
● DC still MaxScale still can do automatic failover.
● But the DR MaxScale can only get lock on “1” node, it’s automatic failover is disabled.
27
Architecture - higher Availability Options
MariaDB
Primary
MaxScale
r/w
MariaDB
Replica
r
Your
Applications
MariaDB
Replica
MaxScale
MariaDB
Replica
r r
MariaDB
Replica
r
Datacenter 2
Datacenter 1
28
MaxScale config_sync_cluster
When configuring MaxScale synchronization for the first time, the same static configuration files should be used on all MaxScale
instances that use same cluster value of “config_sync_cluster” must be the same on all MaxScale instances and the cluster (i.e.
the monitor) pointed by it and its servers must be the same in every configuration.
29
MariaDB HA Clients
MariaDB Connector/J JDBC
https://mariadb.com/kb/en/about-mariadb-connector-j/
MariaDB node.js Connector
https://mariadb.com/docs/xpand/connect/programming-languages/nodejs/promise/connection-pools/
MariaDB Python Connector
https://mariadb.com/docs/server/connect/programming-languages/python/connect/#Connection_Failover
MariaDB ODBC Connector
https://mariadb.com/docs/server/connect/programming-languages/odbc-api/connect/#Failover
MariaDB R2DBC Connector
https://mariadb.com/docs/server/release-notes/mariadb-connector-r2dbc/1-1-2/#Failover_and_Load_Balancing
MariaDB C++ Connector
https://mariadb.com/docs/server/release-notes/mariadb-connector-cpp-1-1/1-1-1/#Notable_Changes
MariaDB Xpand
30
31
Xpand - the distributed OLTP Database
Transactional
Distributed SQL
Full Elasticity (↑↓)
Read/Write Scale
32
Xpand - the distributed OLTP Database
When you run a
distributed Database, you
always think about:
- Data Distribution
- Data Replication
- Skewing
- Shared-nothing
- Distributed SQL
- Data locality
- GEO-Distribution
- read/write
performance
- etc. ….
33
Adding Nodes
replicas
slices
replicas
slices
replicas
slices
Node #1 Node #2 Node #3 NEW Node #4
34
Adding Nodes
replicas
slices
replicas
slices
replicas
slices
replicas
slices
Node #1 Node #2 Node #3 NEW Node #4
35
Self-healing
replicas
slices
replicas
slices
replicas
slices
replicas
slices
Node #1 Node #2 Node #3 Node #4
36
Self-healing - Temporary Failure
replicas
slices
replicas
slices
replicas
slices
replicas
slices
Node #1 Node #2 Node #3 Node #4
37
Self-healing
replicas
slices
replicas
slices
replicas
slices
Node #1 Node #2 Node #3
38
Self-healing
replicas
slices
replicas
slices
replicas
slices
Node #1 Node #2 Node #3
No transactions are blocked during these operations
39
Self-healing
replicas
slices
replicas
slices
replicas
slices
Node #1 Node #2 Node #3
XPAND DEEP DIVE
Distributed Query Processing
41
Product table
(slices 1-10)
Product table
(slices 11-20)
Product table
(slice 21-30)
Product table
(replica 1-10)
Product table
(replica 21-30)
Product table
(replica 11-20)
Distributed Query Processing - UPDATE
UPDATE products
SET price = 999
WHERE sku_id = 5;
Node #1 Node #2 Node #3
42
Node #1 Node #2 Node #3
Product table
(slices 1-10)
Product table
(slices 11-20)
Product table
(slice 21-30)
Product table
(replica 1-10)
Product table
(replica 21-30)
Product table
(replica 11-20)
Distributed Query Processing - UPDATE
SESSION / GTM
Look up slice locations by key
UPDATE products
SET price = 999
WHERE sku_id = 5;
43
Node #1 Node #2 Node #3
Product table
(slices 1-10)
Product table
(slices 11-20)
Product table
(slice 21-30)
Product table
(replica 1-10)
Product table
(replica 21-30)
Product table
(replica 11-20)
Distributed Query Processing - UPDATE
SESSION / GTM
Look up slice location by key
Send code fragments to nodes
SET price = $999
WHERE sku_id = 5
SET price = $999
WHERE sku_id = 5
UPDATE products
SET price = 999
WHERE sku_id = 5;
44
Node #1 Node #2 Node #3
Product table
(slices 1-10)
Product table
(slices 11-20)
Product table
(slice 21-30)
Product table
(replica 1-10)
Product table
(replica 21-30)
Product table
(replica 11-20)
Distributed Query Processing - UPDATE
SESSION / GTM
Look up slice location by key
Send code fragments to nodes
Coordinate transaction
SET price = $999
WHERE sku_id = 5
SET price = $999
WHERE sku_id = 5
Parallel Writes
Commit
Commit
UPDATE products
SET price = 999
WHERE sku_id = 5;
45
Node #1 Node #2 Node #3
Product table
(slices 1-10)
Product table
(slices 11-20)
Product table
(slice 21-30)
Product table
(replica 1-10)
Product table
(replica 21-30)
Product table
(replica 11-20)
Distributed Query Processing - UPDATE
Transaction
Committed
SESSION / GTM
Look up slice location by key
Send code fragments to nodes
Coordinate transaction
UPDATE products
SET price = 999
WHERE sku_id = 5;
XPAND DEEP DIVE
○ Replication
47
Backup and Replication
Xpand
Parallel
Bacup
Asynchronous Replication
Xpand / MySQL / Mariadb
48
Multi-Stream Parallel Replication
Active / Active
Client
Drivers
Client
Drivers
12,500 trx/sec
30% writes
12,500 trx/sec
30% writes
<1 sec Lag between regions
Serves Multiple Problem Domains
49
High Volume, Fast, Parallel
Asynchronous Replication
Active-Active
topology
Passive Standby
for Disaster Recovery
Daisy chain
replication to multiple regions
for global access
mariadb.com

More Related Content

Similar to Hochverfügbarkeitslösungen mit MariaDB

2010 12 mysql_clusteroverview
2010 12 mysql_clusteroverview2010 12 mysql_clusteroverview
2010 12 mysql_clusteroverviewDimas Prasetyo
 
Training Slides: Basics 102: Introduction to Tungsten Clustering
Training Slides: Basics 102: Introduction to Tungsten ClusteringTraining Slides: Basics 102: Introduction to Tungsten Clustering
Training Slides: Basics 102: Introduction to Tungsten Clustering
Continuent
 
MySQL Performance - Best practices
MySQL Performance - Best practices MySQL Performance - Best practices
MySQL Performance - Best practices
Ted Wennmark
 
Apache Spark At Scale in the Cloud
Apache Spark At Scale in the CloudApache Spark At Scale in the Cloud
Apache Spark At Scale in the Cloud
Databricks
 
Apache Spark At Scale in the Cloud
Apache Spark At Scale in the CloudApache Spark At Scale in the Cloud
Apache Spark At Scale in the Cloud
Rose Toomey
 
Slow things down to make them go faster [FOSDEM 2022]
Slow things down to make them go faster [FOSDEM 2022]Slow things down to make them go faster [FOSDEM 2022]
Slow things down to make them go faster [FOSDEM 2022]
Jimmy Angelakos
 
Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_features
AiougVizagChapter
 
Five Lessons in Distributed Databases
Five Lessons  in Distributed DatabasesFive Lessons  in Distributed Databases
Five Lessons in Distributed Databases
jbellis
 
Devops kc
Devops kcDevops kc
Devops kc
Philip Thompson
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
Lenz Grimmer
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability SolutionsLenz Grimmer
 
Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02Louis liu
 
Why new hardware may not make Oracle databases faster
Why new hardware may not make Oracle databases fasterWhy new hardware may not make Oracle databases faster
Why new hardware may not make Oracle databases faster
SolarWinds
 
MySQL 5.6 Replication Webinar
MySQL 5.6 Replication WebinarMySQL 5.6 Replication Webinar
MySQL 5.6 Replication Webinar
Mark Swarbrick
 
MySQL always-up with Galera Cluster
MySQL always-up with Galera ClusterMySQL always-up with Galera Cluster
MySQL always-up with Galera Cluster
FromDual GmbH
 
Running Dataproc At Scale in production - Searce Talk at GDG Delhi
Running Dataproc At Scale in production - Searce Talk at GDG DelhiRunning Dataproc At Scale in production - Searce Talk at GDG Delhi
Running Dataproc At Scale in production - Searce Talk at GDG Delhi
Searce Inc
 
Multi-Tenancy Kafka cluster for LINE services with 250 billion daily messages
Multi-Tenancy Kafka cluster for LINE services with 250 billion daily messagesMulti-Tenancy Kafka cluster for LINE services with 250 billion daily messages
Multi-Tenancy Kafka cluster for LINE services with 250 billion daily messages
LINE Corporation
 
MySQL Parallel Replication by Booking.com
MySQL Parallel Replication by Booking.comMySQL Parallel Replication by Booking.com
MySQL Parallel Replication by Booking.com
Jean-François Gagné
 
Fosdem2012 mariadb-5.3-query-optimizer-r2
Fosdem2012 mariadb-5.3-query-optimizer-r2Fosdem2012 mariadb-5.3-query-optimizer-r2
Fosdem2012 mariadb-5.3-query-optimizer-r2Sergey Petrunya
 

Similar to Hochverfügbarkeitslösungen mit MariaDB (20)

2010 12 mysql_clusteroverview
2010 12 mysql_clusteroverview2010 12 mysql_clusteroverview
2010 12 mysql_clusteroverview
 
Training Slides: Basics 102: Introduction to Tungsten Clustering
Training Slides: Basics 102: Introduction to Tungsten ClusteringTraining Slides: Basics 102: Introduction to Tungsten Clustering
Training Slides: Basics 102: Introduction to Tungsten Clustering
 
MySQL Performance - Best practices
MySQL Performance - Best practices MySQL Performance - Best practices
MySQL Performance - Best practices
 
Apache Spark At Scale in the Cloud
Apache Spark At Scale in the CloudApache Spark At Scale in the Cloud
Apache Spark At Scale in the Cloud
 
Apache Spark At Scale in the Cloud
Apache Spark At Scale in the CloudApache Spark At Scale in the Cloud
Apache Spark At Scale in the Cloud
 
Slow things down to make them go faster [FOSDEM 2022]
Slow things down to make them go faster [FOSDEM 2022]Slow things down to make them go faster [FOSDEM 2022]
Slow things down to make them go faster [FOSDEM 2022]
 
Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_features
 
Five Lessons in Distributed Databases
Five Lessons  in Distributed DatabasesFive Lessons  in Distributed Databases
Five Lessons in Distributed Databases
 
OpenDS_Jazoon2010
OpenDS_Jazoon2010OpenDS_Jazoon2010
OpenDS_Jazoon2010
 
Devops kc
Devops kcDevops kc
Devops kc
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
 
Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02
 
Why new hardware may not make Oracle databases faster
Why new hardware may not make Oracle databases fasterWhy new hardware may not make Oracle databases faster
Why new hardware may not make Oracle databases faster
 
MySQL 5.6 Replication Webinar
MySQL 5.6 Replication WebinarMySQL 5.6 Replication Webinar
MySQL 5.6 Replication Webinar
 
MySQL always-up with Galera Cluster
MySQL always-up with Galera ClusterMySQL always-up with Galera Cluster
MySQL always-up with Galera Cluster
 
Running Dataproc At Scale in production - Searce Talk at GDG Delhi
Running Dataproc At Scale in production - Searce Talk at GDG DelhiRunning Dataproc At Scale in production - Searce Talk at GDG Delhi
Running Dataproc At Scale in production - Searce Talk at GDG Delhi
 
Multi-Tenancy Kafka cluster for LINE services with 250 billion daily messages
Multi-Tenancy Kafka cluster for LINE services with 250 billion daily messagesMulti-Tenancy Kafka cluster for LINE services with 250 billion daily messages
Multi-Tenancy Kafka cluster for LINE services with 250 billion daily messages
 
MySQL Parallel Replication by Booking.com
MySQL Parallel Replication by Booking.comMySQL Parallel Replication by Booking.com
MySQL Parallel Replication by Booking.com
 
Fosdem2012 mariadb-5.3-query-optimizer-r2
Fosdem2012 mariadb-5.3-query-optimizer-r2Fosdem2012 mariadb-5.3-query-optimizer-r2
Fosdem2012 mariadb-5.3-query-optimizer-r2
 

More from MariaDB plc

MariaDB Paris Workshop 2023 - MaxScale 23.02.x
MariaDB Paris Workshop 2023 - MaxScale 23.02.xMariaDB Paris Workshop 2023 - MaxScale 23.02.x
MariaDB Paris Workshop 2023 - MaxScale 23.02.x
MariaDB plc
 
MariaDB Paris Workshop 2023 - Newpharma
MariaDB Paris Workshop 2023 - NewpharmaMariaDB Paris Workshop 2023 - Newpharma
MariaDB Paris Workshop 2023 - Newpharma
MariaDB plc
 
MariaDB Paris Workshop 2023 - Cloud
MariaDB Paris Workshop 2023 - CloudMariaDB Paris Workshop 2023 - Cloud
MariaDB Paris Workshop 2023 - Cloud
MariaDB plc
 
MariaDB Paris Workshop 2023 - MariaDB Enterprise
MariaDB Paris Workshop 2023 - MariaDB EnterpriseMariaDB Paris Workshop 2023 - MariaDB Enterprise
MariaDB Paris Workshop 2023 - MariaDB Enterprise
MariaDB plc
 
MariaDB Paris Workshop 2023 - Performance Optimization
MariaDB Paris Workshop 2023 - Performance OptimizationMariaDB Paris Workshop 2023 - Performance Optimization
MariaDB Paris Workshop 2023 - Performance Optimization
MariaDB plc
 
MariaDB Paris Workshop 2023 - MaxScale
MariaDB Paris Workshop 2023 - MaxScale MariaDB Paris Workshop 2023 - MaxScale
MariaDB Paris Workshop 2023 - MaxScale
MariaDB plc
 
MariaDB Paris Workshop 2023 - novadys presentation
MariaDB Paris Workshop 2023 - novadys presentationMariaDB Paris Workshop 2023 - novadys presentation
MariaDB Paris Workshop 2023 - novadys presentation
MariaDB plc
 
MariaDB Paris Workshop 2023 - DARVA presentation
MariaDB Paris Workshop 2023 - DARVA presentationMariaDB Paris Workshop 2023 - DARVA presentation
MariaDB Paris Workshop 2023 - DARVA presentation
MariaDB plc
 
MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server
MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server
MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server
MariaDB plc
 
MariaDB SkySQL Autonome Skalierung, Observability, Cloud-Backup
MariaDB SkySQL Autonome Skalierung, Observability, Cloud-BackupMariaDB SkySQL Autonome Skalierung, Observability, Cloud-Backup
MariaDB SkySQL Autonome Skalierung, Observability, Cloud-Backup
MariaDB plc
 
Einführung : MariaDB Tech und Business Update Hamburg 2023
Einführung : MariaDB Tech und Business Update Hamburg 2023Einführung : MariaDB Tech und Business Update Hamburg 2023
Einführung : MariaDB Tech und Business Update Hamburg 2023
MariaDB plc
 
Die Neuheiten in MariaDB Enterprise Server
Die Neuheiten in MariaDB Enterprise ServerDie Neuheiten in MariaDB Enterprise Server
Die Neuheiten in MariaDB Enterprise Server
MariaDB plc
 
Global Data Replication with Galera for Ansell Guardian®
Global Data Replication with Galera for Ansell Guardian®Global Data Replication with Galera for Ansell Guardian®
Global Data Replication with Galera for Ansell Guardian®
MariaDB plc
 
Introducing workload analysis
Introducing workload analysisIntroducing workload analysis
Introducing workload analysis
MariaDB plc
 
Under the hood: SkySQL monitoring
Under the hood: SkySQL monitoringUnder the hood: SkySQL monitoring
Under the hood: SkySQL monitoring
MariaDB plc
 
Introducing the R2DBC async Java connector
Introducing the R2DBC async Java connectorIntroducing the R2DBC async Java connector
Introducing the R2DBC async Java connector
MariaDB plc
 
MariaDB Enterprise Tools introduction
MariaDB Enterprise Tools introductionMariaDB Enterprise Tools introduction
MariaDB Enterprise Tools introduction
MariaDB plc
 
Faster, better, stronger: The new InnoDB
Faster, better, stronger: The new InnoDBFaster, better, stronger: The new InnoDB
Faster, better, stronger: The new InnoDB
MariaDB plc
 
The architecture of SkySQL
The architecture of SkySQLThe architecture of SkySQL
The architecture of SkySQL
MariaDB plc
 
What to expect from MariaDB Platform X5, part 1
What to expect from MariaDB Platform X5, part 1What to expect from MariaDB Platform X5, part 1
What to expect from MariaDB Platform X5, part 1
MariaDB plc
 

More from MariaDB plc (20)

MariaDB Paris Workshop 2023 - MaxScale 23.02.x
MariaDB Paris Workshop 2023 - MaxScale 23.02.xMariaDB Paris Workshop 2023 - MaxScale 23.02.x
MariaDB Paris Workshop 2023 - MaxScale 23.02.x
 
MariaDB Paris Workshop 2023 - Newpharma
MariaDB Paris Workshop 2023 - NewpharmaMariaDB Paris Workshop 2023 - Newpharma
MariaDB Paris Workshop 2023 - Newpharma
 
MariaDB Paris Workshop 2023 - Cloud
MariaDB Paris Workshop 2023 - CloudMariaDB Paris Workshop 2023 - Cloud
MariaDB Paris Workshop 2023 - Cloud
 
MariaDB Paris Workshop 2023 - MariaDB Enterprise
MariaDB Paris Workshop 2023 - MariaDB EnterpriseMariaDB Paris Workshop 2023 - MariaDB Enterprise
MariaDB Paris Workshop 2023 - MariaDB Enterprise
 
MariaDB Paris Workshop 2023 - Performance Optimization
MariaDB Paris Workshop 2023 - Performance OptimizationMariaDB Paris Workshop 2023 - Performance Optimization
MariaDB Paris Workshop 2023 - Performance Optimization
 
MariaDB Paris Workshop 2023 - MaxScale
MariaDB Paris Workshop 2023 - MaxScale MariaDB Paris Workshop 2023 - MaxScale
MariaDB Paris Workshop 2023 - MaxScale
 
MariaDB Paris Workshop 2023 - novadys presentation
MariaDB Paris Workshop 2023 - novadys presentationMariaDB Paris Workshop 2023 - novadys presentation
MariaDB Paris Workshop 2023 - novadys presentation
 
MariaDB Paris Workshop 2023 - DARVA presentation
MariaDB Paris Workshop 2023 - DARVA presentationMariaDB Paris Workshop 2023 - DARVA presentation
MariaDB Paris Workshop 2023 - DARVA presentation
 
MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server
MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server
MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server
 
MariaDB SkySQL Autonome Skalierung, Observability, Cloud-Backup
MariaDB SkySQL Autonome Skalierung, Observability, Cloud-BackupMariaDB SkySQL Autonome Skalierung, Observability, Cloud-Backup
MariaDB SkySQL Autonome Skalierung, Observability, Cloud-Backup
 
Einführung : MariaDB Tech und Business Update Hamburg 2023
Einführung : MariaDB Tech und Business Update Hamburg 2023Einführung : MariaDB Tech und Business Update Hamburg 2023
Einführung : MariaDB Tech und Business Update Hamburg 2023
 
Die Neuheiten in MariaDB Enterprise Server
Die Neuheiten in MariaDB Enterprise ServerDie Neuheiten in MariaDB Enterprise Server
Die Neuheiten in MariaDB Enterprise Server
 
Global Data Replication with Galera for Ansell Guardian®
Global Data Replication with Galera for Ansell Guardian®Global Data Replication with Galera for Ansell Guardian®
Global Data Replication with Galera for Ansell Guardian®
 
Introducing workload analysis
Introducing workload analysisIntroducing workload analysis
Introducing workload analysis
 
Under the hood: SkySQL monitoring
Under the hood: SkySQL monitoringUnder the hood: SkySQL monitoring
Under the hood: SkySQL monitoring
 
Introducing the R2DBC async Java connector
Introducing the R2DBC async Java connectorIntroducing the R2DBC async Java connector
Introducing the R2DBC async Java connector
 
MariaDB Enterprise Tools introduction
MariaDB Enterprise Tools introductionMariaDB Enterprise Tools introduction
MariaDB Enterprise Tools introduction
 
Faster, better, stronger: The new InnoDB
Faster, better, stronger: The new InnoDBFaster, better, stronger: The new InnoDB
Faster, better, stronger: The new InnoDB
 
The architecture of SkySQL
The architecture of SkySQLThe architecture of SkySQL
The architecture of SkySQL
 
What to expect from MariaDB Platform X5, part 1
What to expect from MariaDB Platform X5, part 1What to expect from MariaDB Platform X5, part 1
What to expect from MariaDB Platform X5, part 1
 

Recently uploaded

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 

Recently uploaded (20)

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 

Hochverfügbarkeitslösungen mit MariaDB

  • 1. Hochverfügbarkeitslösungen mit MariaDB Stefan Schmit, Senior Solution Engineer CEUR MariaDB plc
  • 2. 2 High Availability - HA High availability (HA) is a characteristic of a system which aims to ensure an agreed level of operational performance, usually uptime, for a higher than normal period. https://en.wikipedia.org/wiki/High_availability
  • 3. https://upload.wikimedia.org/wikipedia/commons/6/69 /RPO_RTO_example_converted.png 3 RPO RTO Recovery Time Objective The Recovery Time Objective (RTO) is the targeted duration of time and a service level within which a business process must be restored after a disruption in order to avoid a break in business continuity. According to business continuity planning methodology, the RTO is established during the Business Impact Analysis (BIA) by the owner(s) of the process, including identifying time frames for alternate or manual workarounds. Recovery Point Objective A Recovery Point Objective (RPO) is the maximum acceptable interval during which transactional data is lost from an IT service. For example, if RPO is measured in minutes, then in practice, off-site mirrored backups must be continuously maintained as a daily off-site backup will not suffice. https://en.wikipedia.org/wiki/Disaster_recovery
  • 5. 5 Architecture - Single Node MariaDB Primary r/w Your Applications Single Node Setup No failover option Backup / Restore is key RPO / RTO define the SLA
  • 6. 6 Architecture - Primary / Replica Setup MariaDB Primary r/w Your Applications Primary / Replica Node Setup “Manual” failover to Slave Asynchronous Replication Semi-synchronous Replication “Passive” Hardware Manual failover process defines the SLA Backup process can run on Slave MariaDB Replica
  • 7. 7 Architecture - Primary / Replica Setup MariaDB Primary r/w Your Applications Primary / Replica Node Setup “Manual” failover to Slave Asynchronous Replication Semi-synchronous Replication Galera Cluster “Passive” Hardware Manual failover process defines the SLA Backup process can run on Slave MariaDB Replica MariaDB Replica
  • 8. Architecture for high Availability with MaxScale MariaDB Primary MaxScale MariaDB Replica r/w r Your Applications MariaDB MaxScale is an advanced SQL firewall, proxy, router, and load balancer: • MaxScale performs automated failover for MariaDB replication. • MaxScale's ReadWriteSplit router performs query-based load balancing. • MaxScale's Cache filter can improve SELECT performance by caching and reusing results. • MaxScale can filter data via Data Masking, with defined patterns • MaxScale also helps to avoid downtimes or hick-ups with - Upgrades and Patches - adding Nodes - DoS attacks - SQL Injection - Security Violations MariaDB Replica r
  • 9. Architecture for high Availability in SkySQL MariaDB Primary MaxScale MariaDB Replica r/w r Your Applications Performance Standard SkySQL Foundation Tier • Multi-node configurations will deliver a 99.95% service availability on a per-billing-month basis. • For example, with this availability target in a 30 day calendar month the maximum service downtime is 21 minutes and 54 seconds. SkySQL Power Tier • Multi-node configurations will deliver a 99.995% service availability on a per-billing-month basis. • For example, with this availability target in a 30 day calendar month the maximum service downtime is 2 minutes and 11 seconds. Availability Zone 2 Availability Zone 1 MariaDB SkySQL SLA
  • 11. Basic HA Architecture 11 MaxScale MaxScale 1 Active Primary Replica-1 Replica-2 Replication ● Only one MaxScale ● Single point of failure ● MariaDB Backend HA
  • 12. Traditional Setup 12 ● Prior to MaxScale 2.5, MaxScale HA required manual intervention ● While all the MaxScale nodes can route queries, read write splitting and other operations, only the “active” MaxScale node (PASSIVE = false) could perform automatic failovers. ● In case of the “active” MaxScale goes down, one of the remaining MaxScale nodes needed to be set to “PASSIVE = false” so that particular node could handle automatic failover. ● This was usually done with the help of third party tools such as ○ keepalived ○ corosync/pacemaker
  • 13. Typical Recommended Architecture (Traditionally) 13 MaxScale MaxScale 1 Active Primary Replica-1 MaxScale MaxScale 2 Passive Replica-2 Replication ● Can’t have both MaxScale doing database Failover ● Must use 3rd Party tools such as KeepaliveD to control which is the “Active” MaxScale ● Issues for support in case of KeepaliveD failure ● Complex Configuration ● Only One MaxScale can be used for Query routing KeepaliveD Virtual IP
  • 14. Why “Cooperative Locking” 14 ● Starting with MaxScale 2.5, Co-op Locking was introduced ● Multiple MaxScale nodes can work together without the need of any third party component(s) ● MaxScale nodes will seamlessly decide which is the primary MaxScale and which is not. ○ This is done by a special locking mechanism. ● Primary MaxScale handles the MariaDB failover. ● Two modes to choose from ○ majority_of_running ○ majority_of_all
  • 15. cooperative_monitoring_locks (maxscale.cnf) 15 majority_of_running ● Default in SkySQL if the customer goes for dual MaxScale setup. ● MaxScale node that has the maximum number of locks will become the Primary ● In this mode, the total number of “Running” MariaDB nodes are considered excluding the nodes that are down. ● Locks required are calculated as ○ Round the result up: n_servers/2 + 1 ○ “n_servers” is the total number alive servers in the cluster ○ Consider a 3 nodes cluster ■ All 3 nodes are alive: round(3/2+1) = 2 ■ 1 Node goes down: round(2/2+1) = 2 ■ 2 Nodes goes down: round(1/2+1) = 1 ○ This supports more nodes failure while still being able to do automatic MariaDB failover.
  • 16. majority_of_running 16 MaxScale MaxScale 1 Primary Primary Primary DC DR DC MaxScale MaxScale 2 Replica-1 Async Replication ● One nodes go down, the minimum of DB locks required reduced to “2”, it can be achieved, ● MaxScale 1 is “primary” ● Automatic DB failover remains activated.
  • 17. majority_of_running 17 MaxScale MaxScale 1 Primary Primary Primary DC DR DC MaxScale MaxScale 2 Primary ● 2 nodes go down, the minimum of DB locks required reduced to “1” which can be still achieved. ● MaxScale 1 is still the “primary” MaxScale ● Automatic DB failover remains activated.
  • 18. majority_of_running 18 MaxScale MaxScale 1 Primary Primary Primary DC DR DC MaxScale MaxScale 2 ● Entire Data Center goes down ● The minimum of DB locks required is reduced to “1” which can be still achieved. ● MaxScale 3 becomes “primary” ● Automatic DB failover remains activated. Primary
  • 19. cooperative_monitoring_locks (maxscale.cnf) 19 majority_of_running ● Can cause split-brain (Multiple MaxScale nodes becoming primary!) ○ Consider a Primary / DR setup ○ In case of a network partition between the two data centers, both MaxScale on each data center will become “Primary” as they can’t see the other side DB nodes. ○ This leads to Two “Primary” MariaDB servers running on each data center! ○ Unlikely scenario but keep this in mind.
  • 20. majority_of_running 20 MaxScale MaxScale 1 Primary Replica-1 Primary DC DR DC MaxScale MaxScale 2 Primary ● Network between the two data centers is LOST ● The MaxScale nodes can only see the DB nodes within their own data centers ● “majority_of_running” rule applies and minimum of locks required is reduced to 2 for DC and is reduced to 1 for DR ● Split-Brain! We now have two “primary” MaxScale nodes! ● The new “primary” MaxScale node in DR, promotes one of the Replica as “Primary DB” ● Two Primary DB nodes running, one on each DC creating data inconsistency! Async Replication
  • 21. cooperative_monitoring_locks (maxscale.cnf) 21 majority_of_all ● In this mode, all the nodes are considered ● MaxScale node that has the maximum number of locks will become the Primary ● Locks required are calculated as ○ Round the result up: n_servers/2 + 1 ○ “n_servers” is the total number of MariaDB servers in the cluster ○ In case of ■ 3 nodes setup, the locks required by MaxScale is round(3/2+1) = 2 ■ 7 nodes setup, the locks required by MaxScale is round(7/2+1) = 4 ● If too many MariaDB nodes going down at the same time, none of the MaxScale nodes will be able to get the minimum number of locks required. ○ Consider, total of 3 backend servers, if 2 nodes go down, the minimum of required locks, “2”, can’t be achieved ○ No automatic failover. ○ Minimum of “n_servers/2 + 1” must be alive for the automatic failover to work
  • 22. majority_of_all 22 MaxScale MaxScale 1 Primary Replica-1 Primary DC DR DC MaxScale MaxScale 2 Replica-2 Async Replication ● Locks required are (round up of) 3/2+1 = 2 ● MaxScale 1 has the max locks for instance, it becomes “primary” ● Other three MaxScale noes are “secondary”
  • 23. majority_of_all 23 MaxScale MaxScale 1 Primary Primary Primary DC DR DC MaxScale MaxScale 2 Replica-2 Async Replication ● One nodes go down, the minimum of DB locks required “2” can be achieved, ● MaxScale 1 is still “primary” ● It is possible, another MaxScale node becomes primary, but only one.
  • 24. majority_of_all 24 MaxScale MaxScale 1 Primary Primary Primary DC DR DC MaxScale MaxScale 2 Replica-2 ● 2 nodes go down, the minimum of DB locks required “2” can no longer be be achieved! ● All the MaxScale nodes become “secondary”, Automatic failover is disabled.
  • 25. cooperative_monitoring_locks (maxscale.cnf) 25 majority_of_all ● This protects against multiple MaxScale nodes becoming primary in case of a split brain scenario ● Good to have in case of poor network network between two data centers.
  • 26. majority_of_all 26 MaxScale MaxScale 1 Primary Replica-1 Primary DC DR DC (Read-Only) MaxScale MaxScale 2 Replica-2 ● Network between the two data centers is broken, all the MaxScale nodes on DC can acquire 2 locks each which the same as minimum requirement of “2” ● DC still MaxScale still can do automatic failover. ● But the DR MaxScale can only get lock on “1” node, it’s automatic failover is disabled.
  • 27. 27 Architecture - higher Availability Options MariaDB Primary MaxScale r/w MariaDB Replica r Your Applications MariaDB Replica MaxScale MariaDB Replica r r MariaDB Replica r Datacenter 2 Datacenter 1
  • 28. 28 MaxScale config_sync_cluster When configuring MaxScale synchronization for the first time, the same static configuration files should be used on all MaxScale instances that use same cluster value of “config_sync_cluster” must be the same on all MaxScale instances and the cluster (i.e. the monitor) pointed by it and its servers must be the same in every configuration.
  • 29. 29 MariaDB HA Clients MariaDB Connector/J JDBC https://mariadb.com/kb/en/about-mariadb-connector-j/ MariaDB node.js Connector https://mariadb.com/docs/xpand/connect/programming-languages/nodejs/promise/connection-pools/ MariaDB Python Connector https://mariadb.com/docs/server/connect/programming-languages/python/connect/#Connection_Failover MariaDB ODBC Connector https://mariadb.com/docs/server/connect/programming-languages/odbc-api/connect/#Failover MariaDB R2DBC Connector https://mariadb.com/docs/server/release-notes/mariadb-connector-r2dbc/1-1-2/#Failover_and_Load_Balancing MariaDB C++ Connector https://mariadb.com/docs/server/release-notes/mariadb-connector-cpp-1-1/1-1-1/#Notable_Changes
  • 31. 31 Xpand - the distributed OLTP Database Transactional Distributed SQL Full Elasticity (↑↓) Read/Write Scale
  • 32. 32 Xpand - the distributed OLTP Database When you run a distributed Database, you always think about: - Data Distribution - Data Replication - Skewing - Shared-nothing - Distributed SQL - Data locality - GEO-Distribution - read/write performance - etc. ….
  • 36. 36 Self-healing - Temporary Failure replicas slices replicas slices replicas slices replicas slices Node #1 Node #2 Node #3 Node #4
  • 38. 38 Self-healing replicas slices replicas slices replicas slices Node #1 Node #2 Node #3 No transactions are blocked during these operations
  • 40. XPAND DEEP DIVE Distributed Query Processing
  • 41. 41 Product table (slices 1-10) Product table (slices 11-20) Product table (slice 21-30) Product table (replica 1-10) Product table (replica 21-30) Product table (replica 11-20) Distributed Query Processing - UPDATE UPDATE products SET price = 999 WHERE sku_id = 5; Node #1 Node #2 Node #3
  • 42. 42 Node #1 Node #2 Node #3 Product table (slices 1-10) Product table (slices 11-20) Product table (slice 21-30) Product table (replica 1-10) Product table (replica 21-30) Product table (replica 11-20) Distributed Query Processing - UPDATE SESSION / GTM Look up slice locations by key UPDATE products SET price = 999 WHERE sku_id = 5;
  • 43. 43 Node #1 Node #2 Node #3 Product table (slices 1-10) Product table (slices 11-20) Product table (slice 21-30) Product table (replica 1-10) Product table (replica 21-30) Product table (replica 11-20) Distributed Query Processing - UPDATE SESSION / GTM Look up slice location by key Send code fragments to nodes SET price = $999 WHERE sku_id = 5 SET price = $999 WHERE sku_id = 5 UPDATE products SET price = 999 WHERE sku_id = 5;
  • 44. 44 Node #1 Node #2 Node #3 Product table (slices 1-10) Product table (slices 11-20) Product table (slice 21-30) Product table (replica 1-10) Product table (replica 21-30) Product table (replica 11-20) Distributed Query Processing - UPDATE SESSION / GTM Look up slice location by key Send code fragments to nodes Coordinate transaction SET price = $999 WHERE sku_id = 5 SET price = $999 WHERE sku_id = 5 Parallel Writes Commit Commit UPDATE products SET price = 999 WHERE sku_id = 5;
  • 45. 45 Node #1 Node #2 Node #3 Product table (slices 1-10) Product table (slices 11-20) Product table (slice 21-30) Product table (replica 1-10) Product table (replica 21-30) Product table (replica 11-20) Distributed Query Processing - UPDATE Transaction Committed SESSION / GTM Look up slice location by key Send code fragments to nodes Coordinate transaction UPDATE products SET price = 999 WHERE sku_id = 5;
  • 46. XPAND DEEP DIVE ○ Replication
  • 47. 47 Backup and Replication Xpand Parallel Bacup Asynchronous Replication Xpand / MySQL / Mariadb
  • 48. 48 Multi-Stream Parallel Replication Active / Active Client Drivers Client Drivers 12,500 trx/sec 30% writes 12,500 trx/sec 30% writes <1 sec Lag between regions
  • 49. Serves Multiple Problem Domains 49 High Volume, Fast, Parallel Asynchronous Replication Active-Active topology Passive Standby for Disaster Recovery Daisy chain replication to multiple regions for global access