Slides for the webinar held on January 21st 2014
Repair & Recovery for your MySQL, MariaDB & MongoDB / TokuMX Clusters
Galera Cluster, NDB Cluster, VIP with HAProxy and Keepalived, MongoDB Sharded Cluster, etc. all have their own availability models. We are aware of these availability models and will demonstrate in this webinar how to take corrective action in case of failures via our cluster management tool, ClusterControl.
In this webinar, Severalnines CTO Johan Andersson will show you how to leverage ClusterControl to detect failures in your database cluster and automatically repair them to maximize the availability of your database services. And Codership CEO Seppo Jaakola will be joining Johan to provide a deep-dive into Galera recovery internals.
Agenda:
Redundancy models for Galera, NDB and MongoDB/TokuMX
Failover & Recovery (Automatic vs Manual)
Zooming into Galera recovery procedures
Split brains in multi-datacenter setups
From these slides you'll learn how Galera integrates with MySQL 5.6 and Global Transaction IDs to enable cross-datacenter and cloud replication over high latency networks.
ABOUT GALERA CLUSTER
Galera Cluster for MySQL is a true multi-master MySQL replication plugin, and has been proven in mission-critical infrastructures of companies like Ping Identity, AVG Technologies, KPN and HP Cloud DNS. In this webcast you¹ll learn about the following Galera Cluster capabilities, including the latest innovations in the new 3.0 release:
Galera Cluster features and benefits
Support for MySQL 5.6
Integration with MySQL Global Transaction Identifiers
Mixing Galera synchronous replication and asynchronous MySQL replication
Deploying in WAN and Cloud environments
Handling high-latency networks
Management of Galera
Maxscale switchover, failover, and auto rejoinWagner Bianchi
How the MariaDB Maxscale Switchover, Failover, and Rejoin works under the hood by Esa Korhonen and Wagner Bianchi.
You can watch the video of the presentation at
https://www.linkedin.com/feed/update/urn:li:activity:6381185640607809536
We will show the advantages of having a geo-distributed database cluster and how to create one using Galera Cluster for MySQL. We will also discuss the configuration and status variables that are involved and how to deal with typical situations on the WAN such as slow, untrusted or unreliable links, latency and packet loss. We will demonstrate a multi-region cluster on Amazon EC2 and perform some throughput and latency measurements in real-time (video http://galeracluster.com/videos/using-galera-replication-to-create-geo-distributed-clusters-on-the-wan-webinar-video-3/)
Using all of the high availability options in MariaDBMariaDB plc
MariaDB provides a number of high availability options, including replication with automatic failover and multi-master clustering. In this session Wagner Bianchi, Principal Remote DBA, provides a comprehensive overview of the high availability features in MariaDB, highlights their impact on consistency and performance, discusses advanced failover strategies and introduces new features such as casual reads and transparent connection failover.
Slides for the webinar held on January 21st 2014
Repair & Recovery for your MySQL, MariaDB & MongoDB / TokuMX Clusters
Galera Cluster, NDB Cluster, VIP with HAProxy and Keepalived, MongoDB Sharded Cluster, etc. all have their own availability models. We are aware of these availability models and will demonstrate in this webinar how to take corrective action in case of failures via our cluster management tool, ClusterControl.
In this webinar, Severalnines CTO Johan Andersson will show you how to leverage ClusterControl to detect failures in your database cluster and automatically repair them to maximize the availability of your database services. And Codership CEO Seppo Jaakola will be joining Johan to provide a deep-dive into Galera recovery internals.
Agenda:
Redundancy models for Galera, NDB and MongoDB/TokuMX
Failover & Recovery (Automatic vs Manual)
Zooming into Galera recovery procedures
Split brains in multi-datacenter setups
From these slides you'll learn how Galera integrates with MySQL 5.6 and Global Transaction IDs to enable cross-datacenter and cloud replication over high latency networks.
ABOUT GALERA CLUSTER
Galera Cluster for MySQL is a true multi-master MySQL replication plugin, and has been proven in mission-critical infrastructures of companies like Ping Identity, AVG Technologies, KPN and HP Cloud DNS. In this webcast you¹ll learn about the following Galera Cluster capabilities, including the latest innovations in the new 3.0 release:
Galera Cluster features and benefits
Support for MySQL 5.6
Integration with MySQL Global Transaction Identifiers
Mixing Galera synchronous replication and asynchronous MySQL replication
Deploying in WAN and Cloud environments
Handling high-latency networks
Management of Galera
Maxscale switchover, failover, and auto rejoinWagner Bianchi
How the MariaDB Maxscale Switchover, Failover, and Rejoin works under the hood by Esa Korhonen and Wagner Bianchi.
You can watch the video of the presentation at
https://www.linkedin.com/feed/update/urn:li:activity:6381185640607809536
We will show the advantages of having a geo-distributed database cluster and how to create one using Galera Cluster for MySQL. We will also discuss the configuration and status variables that are involved and how to deal with typical situations on the WAN such as slow, untrusted or unreliable links, latency and packet loss. We will demonstrate a multi-region cluster on Amazon EC2 and perform some throughput and latency measurements in real-time (video http://galeracluster.com/videos/using-galera-replication-to-create-geo-distributed-clusters-on-the-wan-webinar-video-3/)
Using all of the high availability options in MariaDBMariaDB plc
MariaDB provides a number of high availability options, including replication with automatic failover and multi-master clustering. In this session Wagner Bianchi, Principal Remote DBA, provides a comprehensive overview of the high availability features in MariaDB, highlights their impact on consistency and performance, discusses advanced failover strategies and introduces new features such as casual reads and transparent connection failover.
This is the presentation delivered by Karthik.P.R at MySQL User Camp Bangalore on 09th June 2017. ProxySQL is a high performance MySQL Load Balancer Designed to scale database servers.
GTIDs were introduced to solve replication problems and improve database consistency in MySQL database replication.
When, accidentally, transactions occur on a replica, this introduces GTIDs on that replica that don't exist on the master. When, on a master failover, this replica becomes the new master, and the corresponding binlogs of the errant GTIDs are already purged, replication breaks on the replicas of this new master, because those missing GTIDs can't be retrieved from the binlogs of this new master.
This presentation will talk about GTIDs and how to detect errant GTIDs on a replica (before the corresponding binlogs are purged) and how to look at the corresponding transactions in the binlogs. I'll give some examples of transactions that could happen on a replica that didn't originate from a primary node, explain how this is possible and share some tips on how to avoid this.
Basic understanding of MySQL database replication is assumed.
This presentation was at Percona Live 2019 in Austin, Texas.
https://www.percona.com/live/19/sessions/errant-gtids-breaking-replication-how-to-detect-and-avoid-them
Almost Perfect Service Discovery and Failover with ProxySQL and OrchestratorJean-François Gagné
Of course there is no such thing as perfect service discovery, and we will see why in the talk. However, the way ProxySQL is deployed in this case minimizes the risk for split-brains, and this is why I qualify it as almost perfect. But let’s step back a little...
MySQL alone is not a high availability solution. To provide resilience to primary failure, other components need to be integrated with MySQL. At MessageBird, these additional components are ProxySQL and Orchestrator. In this talk, we describe how ProxySQL is architectured to provide close to perfect Service Discovery and how this, combined with Orchestrator, allows for automatic failover. The talk presents the details of the integration of MySQL, ProxySQL and Orchestrator in Google Cloud (and it would be easy to re-implement a similar architecture at other cloud vendors or on-premises). We will also cover lessons learned for the 2 years this architecture has been in production. Come to this talk to learn more about MySQL high availability, ProxySQL and Orchestrator.
In the first part of Galera Cluster best practices series, we will discuss the following topics:
* ongoing monitoring of the cluster and detection of bottlenecks;
* fine-tuning the configuration based on the actual database workload;
* selecting the optimal State Snapshot Transfer (SST) method;
* backup strategies
(video:http://galeracluster.com/videos/2159/)
MySQL Scalability and Reliability for Replicated EnvironmentJean-François Gagné
You have a working application that is using MySQL: great! At the beginning, you are probably using a single database instance, and maybe – but not necessarily – you have replication for backups, but you are not reading from slaves yet. Scalability and reliability were not the main focus in the past, but they are starting to be a concern. Soon, you will have many databases and you will have to deal with replication lag. This talk will present how to tackle the transition.
We mostly cover standard/asynchronous replication, but we will also touch on Galera and Group Replication. We present how to adapt the application to become replication-friendly, which facilitate reading from and failing over to slaves. We also present solutions for managing read views at scale and enabling read-your-own-writes on slaves. We also touch on vertical and horizontal sharding for when deploying bigger servers is not possible anymore.
Are UNIQUE and FOREIGN KEYs still possible at scale, what are the downsides of AUTO_INCREMENTs, how to avoid overloading replication, what are the limits of archiving, … Come to this talk to get answers and to leave with tools for tackling the challenges of the future.
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison Severalnines
Galera Cluster for MySQL, Percona XtraDB Cluster and MariaDB Cluster (the three “flavours” of Galera Cluster) make use of the Galera WSREP libraries to handle synchronous replication.MySQL Cluster is the official clustering solution from Oracle, while Galera Cluster for MySQL is slowly but surely establishing itself as the de-facto clustering solution in the wider MySQL eco-system.
In this webinar, we will look at all these alternatives and present an unbiased view on their strengths/weaknesses and the use cases that fit each alternative.
This webinar will cover the following:
MySQL Cluster architecture: strengths and limitations
Galera Architecture: strengths and limitations
Deployment scenarios
Data migration
Read and write workloads (Optimistic/pessimistic locking)
WAN/Geographical replication
Schema changes
Management and monitoring
Running MariaDB in multiple data centersMariaDB plc
MariaDB is often deployed in multiple data centers for high availability and/or disaster recovery. Tim Tadeo, Senior Sales Engineer, walks through real-world use cases and the topologies customers have created to leverage multiple data centers. He also discusses important considerations and how to address them, as well as more advanced options such as dedicated binlog servers for cross–data center replication.
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Mydbops
MySQL Clustering over InnoDB engines has grown a lot over the last decade. Galera began working with InnoDB early and then Group Replication came to the environment later, where the features are now rich and robust. This presentation offers a technical comparison of both of them.
Advanced Percona XtraDB Cluster in a nutshell... la suiteKenny Gryp
Percona XtraDB Cluster is a high availability and high scalability solution for MySQL clustering. Percona XtraDB Cluster integrates Percona Server with the Galera synchronous replication library in a single product package which enables you to create a cost-effective MySQL cluster.
Since three years during Percona Live we initiate people to this technology... but what's next ? This tutorial is the continuation. It targets users that already have experience with PXC and want to go further.
This tutorial will cover the following topics:
- monitoring and trending
- problem solving
- limitations, when not to choose for PXC
- how to test ? (benchmark)
- schema changes
- backups
- multi datacenter
- advanced load balancing with HA Pproxy and Maxscale
- fine tune some important variables like galera cache, flow control limit, ...
24시간 365일 서비스를 위한 MySQL DB 이중화.
MySQL 이중화 방안들에 대해 알아보고 운영하면서 겪은 고민들을 이야기해 봅니다.
목차
1. DB 이중화 필요성
2. 이중화 방안
- HW 이중화
- MySQL Replication 이중화
3. 이중화 운영 장애
4. DNS와 VIP
5. MySQL 이중화 솔루션 비교
대상
- MySQL을 서비스하고 있는 인프라 담당자
- MySQL 이중화에 관심 있는 개발자
MySQL Parallel Replication (LOGICAL_CLOCK): all the 5.7 (and some of the 8.0)...Jean-François Gagné
Since 5.7.2, MySQL implements parallel replication in the same schema, also known as LOGICAL_CLOCK (DATABASE based parallel replication is also implemented in 5.6 but this is not covered in this talk). In early 5.7 versions, parallel replication was based on group commit (like MariaDB) and 5.7.6 changed that to intervals.
Intervals are more complicated but they are also more powerful. In this talk, I will explain in detail how they work and why intervals are better than group commit. I will also cover how to optimize parallel replication in MySQL 5.7 and what improvements are coming in MySQL 8.0. I will also explain why Group Replication is replicating faster than standard asynchronous replication.
Come to this talk to get all the details about MySQL 5.7 Parallel Replication.
Introducing Galera Cluster & the Codership Team
Galera Cluster in a nutshell:
True multi-master:
Read & write to any node
* Synchronous replication
* No slave lag
* No integrity issues
* No master-slave failovers or VIP needed
* Multi-threaded slave, no performance penalty
* Automatic node provisioning
Elastic:
Easy scale-out & scale-in, all nodes read-write
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleColin Charles
As proxies (and database routers) go, the first one I ever used was the now deprecated MySQL Proxy. Since then, I've managed to use MariaDB MaxScale quite a bit (including its fork AirBnB MaxScale), played around with ProxySQL in recent time, and also started taking a look at MySQL Router. In this quick 20-minute overview, we'll discuss why these three exist, a feature comparison, and reasons when to use the right tool for the job.
MySQL Parallel Replication: inventory, use-case and limitationsJean-François Gagné
In the last 24 months, MySQL/MariaDB replication speed has improved a lot thanks to parallel replication. MySQL and MariaDB have different types of parallel replication; in this talk, I present the different implementations, with their limitations and the corresponding tuning parameters. I cover what to do to make parallel replication faster and what to avoid for maximizing parallel replication benefits. I also present benchmark results from real Booking.com workloads. Finally, I discuss some deployments at Booking.com that take advantage of parallel replication speed improvements.
Galera cluster for MySQL - Introduction SlidesSeveralnines
This set of slides gives you an overview of Galera, configuration basics and deployment best practices.
The following topics are covered:
- Concepts
- Node provisioning
- Network partitioning
- Configuration example
- Benchmarks
- Deployment best practices
- Galera monitoring and management
We always say Galera replication is synchronous, but is it really? Always? For every step? What are the caveats of such replication? What does virtual-synchronous mean?
In this talk, I'll discuss what certification and group communication are, and how they're performed. I'll also cover the difference between MySQL 5.6 GTID and Galera GTID. The goal of this presentation is to explain how a transaction is replicated using Galera.
After this presentation, the audience should be comfortable with terms like "brute force abort," "flow control," "local certification failure," etc.
The plan is to demystify Galera technology with easy illustrations and analogies.
This is the presentation delivered by Karthik.P.R at MySQL User Camp Bangalore on 09th June 2017. ProxySQL is a high performance MySQL Load Balancer Designed to scale database servers.
GTIDs were introduced to solve replication problems and improve database consistency in MySQL database replication.
When, accidentally, transactions occur on a replica, this introduces GTIDs on that replica that don't exist on the master. When, on a master failover, this replica becomes the new master, and the corresponding binlogs of the errant GTIDs are already purged, replication breaks on the replicas of this new master, because those missing GTIDs can't be retrieved from the binlogs of this new master.
This presentation will talk about GTIDs and how to detect errant GTIDs on a replica (before the corresponding binlogs are purged) and how to look at the corresponding transactions in the binlogs. I'll give some examples of transactions that could happen on a replica that didn't originate from a primary node, explain how this is possible and share some tips on how to avoid this.
Basic understanding of MySQL database replication is assumed.
This presentation was at Percona Live 2019 in Austin, Texas.
https://www.percona.com/live/19/sessions/errant-gtids-breaking-replication-how-to-detect-and-avoid-them
Almost Perfect Service Discovery and Failover with ProxySQL and OrchestratorJean-François Gagné
Of course there is no such thing as perfect service discovery, and we will see why in the talk. However, the way ProxySQL is deployed in this case minimizes the risk for split-brains, and this is why I qualify it as almost perfect. But let’s step back a little...
MySQL alone is not a high availability solution. To provide resilience to primary failure, other components need to be integrated with MySQL. At MessageBird, these additional components are ProxySQL and Orchestrator. In this talk, we describe how ProxySQL is architectured to provide close to perfect Service Discovery and how this, combined with Orchestrator, allows for automatic failover. The talk presents the details of the integration of MySQL, ProxySQL and Orchestrator in Google Cloud (and it would be easy to re-implement a similar architecture at other cloud vendors or on-premises). We will also cover lessons learned for the 2 years this architecture has been in production. Come to this talk to learn more about MySQL high availability, ProxySQL and Orchestrator.
In the first part of Galera Cluster best practices series, we will discuss the following topics:
* ongoing monitoring of the cluster and detection of bottlenecks;
* fine-tuning the configuration based on the actual database workload;
* selecting the optimal State Snapshot Transfer (SST) method;
* backup strategies
(video:http://galeracluster.com/videos/2159/)
MySQL Scalability and Reliability for Replicated EnvironmentJean-François Gagné
You have a working application that is using MySQL: great! At the beginning, you are probably using a single database instance, and maybe – but not necessarily – you have replication for backups, but you are not reading from slaves yet. Scalability and reliability were not the main focus in the past, but they are starting to be a concern. Soon, you will have many databases and you will have to deal with replication lag. This talk will present how to tackle the transition.
We mostly cover standard/asynchronous replication, but we will also touch on Galera and Group Replication. We present how to adapt the application to become replication-friendly, which facilitate reading from and failing over to slaves. We also present solutions for managing read views at scale and enabling read-your-own-writes on slaves. We also touch on vertical and horizontal sharding for when deploying bigger servers is not possible anymore.
Are UNIQUE and FOREIGN KEYs still possible at scale, what are the downsides of AUTO_INCREMENTs, how to avoid overloading replication, what are the limits of archiving, … Come to this talk to get answers and to leave with tools for tackling the challenges of the future.
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison Severalnines
Galera Cluster for MySQL, Percona XtraDB Cluster and MariaDB Cluster (the three “flavours” of Galera Cluster) make use of the Galera WSREP libraries to handle synchronous replication.MySQL Cluster is the official clustering solution from Oracle, while Galera Cluster for MySQL is slowly but surely establishing itself as the de-facto clustering solution in the wider MySQL eco-system.
In this webinar, we will look at all these alternatives and present an unbiased view on their strengths/weaknesses and the use cases that fit each alternative.
This webinar will cover the following:
MySQL Cluster architecture: strengths and limitations
Galera Architecture: strengths and limitations
Deployment scenarios
Data migration
Read and write workloads (Optimistic/pessimistic locking)
WAN/Geographical replication
Schema changes
Management and monitoring
Running MariaDB in multiple data centersMariaDB plc
MariaDB is often deployed in multiple data centers for high availability and/or disaster recovery. Tim Tadeo, Senior Sales Engineer, walks through real-world use cases and the topologies customers have created to leverage multiple data centers. He also discusses important considerations and how to address them, as well as more advanced options such as dedicated binlog servers for cross–data center replication.
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Mydbops
MySQL Clustering over InnoDB engines has grown a lot over the last decade. Galera began working with InnoDB early and then Group Replication came to the environment later, where the features are now rich and robust. This presentation offers a technical comparison of both of them.
Advanced Percona XtraDB Cluster in a nutshell... la suiteKenny Gryp
Percona XtraDB Cluster is a high availability and high scalability solution for MySQL clustering. Percona XtraDB Cluster integrates Percona Server with the Galera synchronous replication library in a single product package which enables you to create a cost-effective MySQL cluster.
Since three years during Percona Live we initiate people to this technology... but what's next ? This tutorial is the continuation. It targets users that already have experience with PXC and want to go further.
This tutorial will cover the following topics:
- monitoring and trending
- problem solving
- limitations, when not to choose for PXC
- how to test ? (benchmark)
- schema changes
- backups
- multi datacenter
- advanced load balancing with HA Pproxy and Maxscale
- fine tune some important variables like galera cache, flow control limit, ...
24시간 365일 서비스를 위한 MySQL DB 이중화.
MySQL 이중화 방안들에 대해 알아보고 운영하면서 겪은 고민들을 이야기해 봅니다.
목차
1. DB 이중화 필요성
2. 이중화 방안
- HW 이중화
- MySQL Replication 이중화
3. 이중화 운영 장애
4. DNS와 VIP
5. MySQL 이중화 솔루션 비교
대상
- MySQL을 서비스하고 있는 인프라 담당자
- MySQL 이중화에 관심 있는 개발자
MySQL Parallel Replication (LOGICAL_CLOCK): all the 5.7 (and some of the 8.0)...Jean-François Gagné
Since 5.7.2, MySQL implements parallel replication in the same schema, also known as LOGICAL_CLOCK (DATABASE based parallel replication is also implemented in 5.6 but this is not covered in this talk). In early 5.7 versions, parallel replication was based on group commit (like MariaDB) and 5.7.6 changed that to intervals.
Intervals are more complicated but they are also more powerful. In this talk, I will explain in detail how they work and why intervals are better than group commit. I will also cover how to optimize parallel replication in MySQL 5.7 and what improvements are coming in MySQL 8.0. I will also explain why Group Replication is replicating faster than standard asynchronous replication.
Come to this talk to get all the details about MySQL 5.7 Parallel Replication.
Introducing Galera Cluster & the Codership Team
Galera Cluster in a nutshell:
True multi-master:
Read & write to any node
* Synchronous replication
* No slave lag
* No integrity issues
* No master-slave failovers or VIP needed
* Multi-threaded slave, no performance penalty
* Automatic node provisioning
Elastic:
Easy scale-out & scale-in, all nodes read-write
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleColin Charles
As proxies (and database routers) go, the first one I ever used was the now deprecated MySQL Proxy. Since then, I've managed to use MariaDB MaxScale quite a bit (including its fork AirBnB MaxScale), played around with ProxySQL in recent time, and also started taking a look at MySQL Router. In this quick 20-minute overview, we'll discuss why these three exist, a feature comparison, and reasons when to use the right tool for the job.
MySQL Parallel Replication: inventory, use-case and limitationsJean-François Gagné
In the last 24 months, MySQL/MariaDB replication speed has improved a lot thanks to parallel replication. MySQL and MariaDB have different types of parallel replication; in this talk, I present the different implementations, with their limitations and the corresponding tuning parameters. I cover what to do to make parallel replication faster and what to avoid for maximizing parallel replication benefits. I also present benchmark results from real Booking.com workloads. Finally, I discuss some deployments at Booking.com that take advantage of parallel replication speed improvements.
Galera cluster for MySQL - Introduction SlidesSeveralnines
This set of slides gives you an overview of Galera, configuration basics and deployment best practices.
The following topics are covered:
- Concepts
- Node provisioning
- Network partitioning
- Configuration example
- Benchmarks
- Deployment best practices
- Galera monitoring and management
We always say Galera replication is synchronous, but is it really? Always? For every step? What are the caveats of such replication? What does virtual-synchronous mean?
In this talk, I'll discuss what certification and group communication are, and how they're performed. I'll also cover the difference between MySQL 5.6 GTID and Galera GTID. The goal of this presentation is to explain how a transaction is replicated using Galera.
After this presentation, the audience should be comfortable with terms like "brute force abort," "flow control," "local certification failure," etc.
The plan is to demystify Galera technology with easy illustrations and analogies.
Presentation made at JavaONE, Hyderabad, on 10th May 2011. Slides are a slightly modified version of what's presented by Linda D. at JavaONE, SF, in 2010.
Best practices for MySQL High AvailabilityColin Charles
The MariaDB/MySQL world is full of tradeoffs, and choosing a high availability (HA) solution is no exception. This session aims to look at all the alternatives in an unbiased way. Preference is of course only given to open source solutions.
How do you choose between: asynchronous/semi-synchronous/synchronous replication, MHA (MySQL high availability tools), DRBD, Tungsten Replicator, or Galera Cluster? Do you integrate Pacemaker and Heartbeat like Percona Replication Manager? The cloud brings even more fun, especially if you are dealing with a hybrid cloud and must think about geographical redundancy.
What about newer solutions like using Consul for MySQL HA?
When you’ve decided on your solution, how do you provision and monitor these solutions?
This and more will be covered in a walkthrough of MySQL HA options and when to apply them.
Group Replication went Generally Available end of 2016, it introduces a 'synchronous' active:active multi-master eplication, in addition to asynchronous and semi-synchronous replication, the latter 2 being available in in MySQL for longtime.
As with any new feature, and especially with introducing active:active multi-master replication, it takes a while before companies are adopting the software in production database environment.
For example, even though MySQL 5.7 has been GA for more than a year, adoption is only starting to increase recently.
We can, and should, expect the same from Group Replication. As with every release, bugs will be found, and with new features, best practises still need to formed out of practical experience.
After giving a short introduction on what Group Replication is, I will cover my experience so far in evaluating Group Replication.
MySQL/MariaDB replication is asynchronous. You can make replication faster by using better hardware (faster CPU, more RAM, or quicker disks), or you can use parallel replication to remove it single-threaded limitation; but lag can still happen. This talk is not about making replication faster, it is how to deal with its asynchronous nature, including the (in-)famous lag.
We will start by explaining the consequences of asynchronous replication and how/when lag can happen. Then, we will present the solution used at Booking.com to avoid both creating lag and minimize the consequence of stale reads on slaves (hint: this solution does not mean reading from the master because this does not scale).
Once all above is well understood, we will discuss how Booking.com’s solution can be improved: this solution was designed years ago and we would do this differently if starting from scratch today. Finally, I will present an innovative way to avoid lag: the no-slave-left-behind MariaDB patch.
MariaDB Galera Cluster Webinar by Ivan Zoratti on 13.11.2013. Also available as on demand webinar at http://www.skysql.com/why-skysql/webinars/mariadb-galera-cluster-simple-transparent-highly-available
Training Slides: 202 - Monitoring & TroubleshootingContinuent
Learn all you need to know in this 43min training session about the ins and outs of cluster health monitoring and what tools to use to identify issues, using the logs to understand them better as well as some best practices on how to resolve them.
TOPICS COVERED
Discuss tools used to monitor cluster health
Discuss tools used to identify issues
How to get more information about issues using the logs
Resolve common replication issues
Resolve common clustering issues
Get more information about replication lag
Retaining Goodput with Query Rate LimitingScyllaDB
Distributed systems are usually optimized with particular workloads in mind. At the same time, the system should still behave in a sane way when the assumptions about workload do not hold - notably, one user shouldn't be able to ruin the whole system's performance. Buggy parts of the system can be a source of the overload as well, so it is worth considering overload protection on a per-component basis. For example, ScyllaDB's shared-nothing architecture gives it great scalability, but at the same time makes it prone to a "hot partition" problem: a single partition accessed with disproportionate frequency can ruin performance for other requests handled by the same shards. This talk will describe how we implemented rate limiting on a per-partition basis which reduces the performance impact in such a case, and how we reduced the CPU cost of handling failed requests such as timeouts (spoiler: it's about C++ exceptions).
Using galera replication to create geo distributed clusters on the wanSakari Keskitalo
We will show the advantages of having a geo-distributed database cluster and how to create one using Galera Cluster for MySQL. We will also discuss the configuration and status variables that are involved and how to deal with typical situations on the WAN such as slow, untrusted or unreliable links, latency and packet loss. We will demonstrate a multi-region cluster on Amazon EC2 and perform some throughput and latency measurements in real-time.
Using galera replication to create geo distributed clusters on the wanSakari Keskitalo
We will show the advantages of having a geo-distributed database cluster and how to create one using Galera Cluster for MySQL. We will also discuss the configuration and status variables that are involved and how to deal with typical situations on the WAN such as slow, untrusted or unreliable links, latency and packet loss. We will demonstrate a multi-region cluster on Amazon EC2 and perform some throughput and latency measurements in real-time.
SUE 2018 - Migrating a 130TB Cluster from Elasticsearch 2 to 5 in 20 Hours Wi...Fred de Villamil
The talk I gave at the Snow Unix Event in Nederland about upgrading a massive production Elasticsearch cluster from a major version to another without downtime and a complete rollback plan.
Built-in MySQL Replication is known for its capability to enable to scale reads easily. However, there are some limitations and known issues with this solution because of the asynchronous nature of this replication. This talk will describe another way of doing MySQL replication, by using synchronous replication, available in Percona XtraDB Cluster. The open source solution will be explained and compared to traditional asynchronous MySQL replication, as well as some known use cases will be described. Percona XtraDB Cluster is an, open source, high availability and high scalability solution for MySQL clustering. Features include: Synchronous replication, Multi-master replication support, Parallel replication, Automatic node provisioning.
Speakers: Jingcheng Du and Ramkrishna Vasudevan (Intel)
As HBase continues to expand in application and enterprise or government deployments, there is a growing demand for storing data across geographically distributed datacenters for improved availability and disaster recovery. The Cross-Site BigTable extends HBase to make it well-suited for such deployments, providing the capabilities of creating and accessing HBase tables that are partitioned and asynchronously backed-up over a number of distributed datacenters. This talk reveals how the Cross-Site BigTable manages data access over multiple datacenters and removes the data center itself as a single point of failure in geographically distributed HBase deployments.
Percona xtra db cluster(pxc) non blocking operations, what you need to know t...Marco Tusa
Performing simple DDL operations as ADD/DROP INDEX in a tightly connected cluster as PXC, can become a nightmare. Metalock will prevent Data modifications for long period of time and to bypass this, we need to become creative, like using Rolling schema upgrade or Percona online-schema-change. With NBO, we will be able to avoid such craziness at least for a simple operation like adding an index. In this brief talk I will illustrate what you should do to see the negative effect of NON using NBO, as well what you should do to use it correctly and what to expect out of it.
The constant pressure to move DATA in containers and Kubernetes is creating a lot of confusion and misunderstanding.
This is particularly dangerous when talking about Relational Database Management System.
MySQL, as well as Oracle, Postgres or SQL Server, is a RDBM, as such subject to the erroneous interpretation caused by this new crazy shining things that will solve all. In this short talk we will clarify, that first of all, we are not looking to something new and second why we need to be very careful when talking about using Kubernetes and containers for RDBMS.
Comparing high availability solutions with percona xtradb cluster and percona...Marco Tusa
Percona XtraDB Cluster (PXC) is currently the most popular solution for HA in the MySQL ecosystem, and any solutions Galera-based as PXC have been the only viable option when looking for a high grade of HA using synchronous replication.
But Oracle had intensively worked on making Group Replication more solid and easy to use.
It is time to identify if Group Replication and attached solutions, like InnoDB cluster, can compete or even replace solutions based on Galera.
This presentation will focus on comparing the two solutions and how they behave when serving basic HA problems.
Attendees will be able to get a clearer understanding of which solutions will serve them better, and in which cases.
Accessing data through hibernate: what DBAs should tell to developers and vic...Marco Tusa
Accessing data through Hibernate, what DBA should tell to developers by Marco Tusa & Francisco Bordenave
This presentation will go through the simple process of accessing data from a Java application. What actually happens when we use a simple direct connection, and what instead happen using an ORM/Persistent layer like hibernate. How this apparently makes programmers life easier and DBAs days more difficult.
Best practice-high availability-solution-geo-distributed-finalMarco Tusa
Nowadays implementing different grades of business continuity for the data layer storage is a common requirement. When designing architectures that include MySQL as a data layer, we have different options to cover the required target. Nevertheless we still see a lot of confusion when in the need to properly cover concepts such as High Availability and Disaster Recovery. Confusion that often leads to improper architecture design and wrong solution implementation. This presentation aims to remove that confusion and provide clear guidelines when in the need to design a robust, flexible resilient architecture for your data layer.
In this presentation I am illustrating how and why InnodDB perform Merge and Split pages. I will also show what are the possible things to do to reduce the impact.
Robust HA Solutions - Native Support for PXC and InnoDB cluster in ProxySQL
This talk will illustrate and discuss several MySQL reference architectures that implement a different grade of tightly coupled database cluster.
We will show how ProxySQL implementation is a natural fit in all of them, and how easily it will provide additional stability and functionalities improvement.
Secure our data is a complex topic. We can build a very strong protection around our data, but nothing will prevent the one WHO could potentially access it to compromise the data integrity or to expose it.
This because we either under estimate the control we can or should impose, or because we think to do not have the tools to perform such control.
Nowadays to be able to control and manage what can access our data is a must, while how to do with standard tools it is a nightmare.
The presentation will guide you in a journey, there you will discover how implementing a quite robust protection, more than what you thought was possible.
Even more, it is possible and your performances will even improve. Cool right?
We will discuss:
- Access using not standard port
- Implement selective query access
- Define accessibility by location/ip/id
- Reduce to minimum cost of filtering
- Automate the query discovery
Are we there Yet?? (The long journey of Migrating from close source to opens...Marco Tusa
Migrating from Oracle to MySQL or another Open source RDBMS like Postgres is not as straightforward as many think if not well guided. Check what it means doing with someone that has done it already.
Mysql8 advance tuning with resource groupMarco Tusa
I have a very noisy secondary application written by a very, very bad developer that accesses my servers, mostly with read queries, and occasionally with write updates. Reads and writes are obsessive and create an impact on the MAIN application. My task is to limit the impact of this secondary application without having the main one affected. To do that I will create two resource groups, one for WRITE and another for READ. The first group, Write_app2, will have no cpu affiliation, but will have lowest priority.
Advance Sharding Solution with ProxySQL
ProxySQL is a very powerful platform that allows us to manipulate and manage our connections and queries in a simple but effective way.
Historically MySQL lacks in sharding capability. This significant missing part had often cause developer do implement sharding at application level, or DBA/SA to move on to another solution.
ProxySQL comes with an elegant and simple solution that allow us to implement sharding capability with MySQL without the need to perform significant, or at all, changes in the code.
This brief presentation will illustrate how to successfully configure and use ProxySQL to perform sharding, from very simple approach based on connection user/ip/port, to complicate ones that see the need to read values inside queries.
Geographically dispersed perconaxtra db cluster deploymentMarco Tusa
Geographically Dispersed Percona XtraDB Cluster Deployment
Percona XtraDB Cluster is a very robust, high performing and widly used solution to answer to High Availability needs. But it can be very challinging when we are in the need to deploy the cluster over a geographically disperse area.
This presentation will briefely discuss what is the right approach to sucessfully deploy PXC when in the need to cover multiple geographical sites, close and far.
- What is PXC and what happens in a set of node when commit
- Let us clarify, geo dispersed
- What to keep in mind then
- how to measure it correctly
- Use the right way (sync/async)
- Use help like replication_manager
After some years, MySQL with Galera became the most common solution for synchronous replication. The cloud (and EC2 in particular) was one of the platforms that most successfully employed MySQL/Galera installations.
This year with Aurora, Amazon introduced an alternative solution that use all the flexibility of AWS and simplicity of RDS.
This presentation describes the behavior of both MySQL/Galera and Aurora, showing the details of how the two different solutions behave when dealing with same load. We will highlight the strong point of each, and which represents the best tool - depending on the needs of the situation.
Attendees will be able to make an informed decision on what kind of solutions will be the most efficient, in respect to their actual requirements.
Presentation shows how ProxySQL can improve the HA in solution like MySQL async and sync replication without the need to increase the platform complexity.
Scaling with sync_replication using Galera and EC2Marco Tusa
Challenging architecture design, and proof of concept on a real case of study using Syncrhomous solution.
Customer asks me to investigate and design MySQL architecture to support his application serving shops around the globe.
Scale out and scale in base to sales seasons.
Opendatabay - Open Data Marketplace.pptxOpendatabay
Opendatabay.com unlocks the power of data for everyone. Open Data Marketplace fosters a collaborative hub for data enthusiasts to explore, share, and contribute to a vast collection of datasets.
First ever open hub for data enthusiasts to collaborate and innovate. A platform to explore, share, and contribute to a vast collection of datasets. Through robust quality control and innovative technologies like blockchain verification, opendatabay ensures the authenticity and reliability of datasets, empowering users to make data-driven decisions with confidence. Leverage cutting-edge AI technologies to enhance the data exploration, analysis, and discovery experience.
From intelligent search and recommendations to automated data productisation and quotation, Opendatabay AI-driven features streamline the data workflow. Finding the data you need shouldn't be a complex. Opendatabay simplifies the data acquisition process with an intuitive interface and robust search tools. Effortlessly explore, discover, and access the data you need, allowing you to focus on extracting valuable insights. Opendatabay breaks new ground with a dedicated, AI-generated, synthetic datasets.
Leverage these privacy-preserving datasets for training and testing AI models without compromising sensitive information. Opendatabay prioritizes transparency by providing detailed metadata, provenance information, and usage guidelines for each dataset, ensuring users have a comprehensive understanding of the data they're working with. By leveraging a powerful combination of distributed ledger technology and rigorous third-party audits Opendatabay ensures the authenticity and reliability of every dataset. Security is at the core of Opendatabay. Marketplace implements stringent security measures, including encryption, access controls, and regular vulnerability assessments, to safeguard your data and protect your privacy.
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...John Andrews
SlideShare Description for "Chatty Kathy - UNC Bootcamp Final Project Presentation"
Title: Chatty Kathy: Enhancing Physical Activity Among Older Adults
Description:
Discover how Chatty Kathy, an innovative project developed at the UNC Bootcamp, aims to tackle the challenge of low physical activity among older adults. Our AI-driven solution uses peer interaction to boost and sustain exercise levels, significantly improving health outcomes. This presentation covers our problem statement, the rationale behind Chatty Kathy, synthetic data and persona creation, model performance metrics, a visual demonstration of the project, and potential future developments. Join us for an insightful Q&A session to explore the potential of this groundbreaking project.
Project Team: Jay Requarth, Jana Avery, John Andrews, Dr. Dick Davis II, Nee Buntoum, Nam Yeongjin & Mat Nicholas
2. About me Marco “The Grinch”
• Former UN, MySQL AB,
Pythian, Percona
• 2 kids, 1 wife
• Ex-MySQL AB employee
• History of Religions;
Ski; Snowboard; Scuba Di
ving;
4. Why you are here
• You want to understand what Galera Cluster is
• You know what it is, but want to know more
• You’d like to grill the speaker with some nasty
questions about it (wait for the end!)
• You’re bored, with nothing better to do (a special
welcome to you!)
5. Agenda
• What is Galera?
• How does Galera work?
• What is a Node?
• Node Status
• Primary Component
• Quorum
• Data Replication (Synch.)
• Optimistic & Pessimistic locking
• Write-set Cache
• State Transfer
• Flow Control
• Apply DDL
• Geographic Distribution
• Galera & Binary Logs
• What to keep an Eye on
• Well-known issues
6. What is Galera?
(Virtually) Synchronous Replication:
– True multi-master
– No slave lag
– No master-slave failover or VIP
– Multi-threaded app layers
– Automatic node provisioning
– Elastic scale (in – out)
– Geographic distributed (with segments)
– Mix with Async replication Galera
Balancer
Web traffic
7. Data Replication (sync)
Pros
– High Availability Synchronous replication provides highly available
clusters and guarantees 24/7 service availability, given that:
» No data loss when nodes crash.
» Data replicas remain consistent.
» No complex, time-consuming failovers.
– Improved Performance replications allows you to execute transactions on
all nodes in the cluster in parallel to each other, increasing performance.
– Causality across the Cluster Synchronous replication guarantees causality
across the whole cluster.
8. What is Galera NOT?
• Not Write-scalable solution
• Not great for a high amount of
parallel, small requests
• Not great for working with Foreign
Keys
• Not good for sharding Data (each
node has the entire dataset)
Galera
Balancer
Web traffic
9. Data Replication (sync) (adv)
Cons
– Do not scale on write
– Use a two phase commit, or
distributed locking with capacity
formula: m = n x o x t (where
messages/sec = number of nodes
due to process o number of
operation with t transaction
throughput)
– More nodes more Dead locks &
conflicts
10. Comparing Galera with:
MHA
– Each Slave has its own position
– Data is replicate asynchronously
– In case of crash ONLY one server could
be elected, and in some cases needs to
wait update from binlog
Galera
– Data is the same at each finalize
commit
– All Nodes share the same position
– Any Node can be written at any
time
Master
Log_pos=1000
Slave Log_pos=995
Slave Log_pos=993
Slave Log_pos=980
Slave Log_pos=998
Async
Replicatio
n
In Case of Master crash
Election by position
11. Comparing Galera with:
Continuent Enterprise
– Applications connect to an entry point
– All data is distributed asynchronously
– A central point keep information on all
Galera
– Application can connect any node
– Data is shared using XA transactions
– Status and State is at cluster level
Async
Replication
Canada Italy
Entry point
(man in the
middle)
12. Galera and HAProxy
Two friends working together
• Automatic Donor/fail/resurrection identification
• Automatic write distribution
• Light process scaling on Application server (no single point of failure)
13. • Transactional Database It requires that the database is transactional.
Specifically, that the database can rollback uncommitted changes.
• Atomic Changes It requires that replication events change the
database atomically. Specifically, that the series of database
operations must either all occur, else nothing occurs.
• Global Ordering It requires that replication events are ordered
globally. Specifically, that they are applied on all instances in the same
order.
Galera minimal requirements
14. How does Galera work? 1
Main components corresponding to code
blocks
• Database Management System (DBMS) The database
server that runs on the individual node.
• wsrep API The interface and the responsibilities for the
database server and replication provider
• Galera Replication Plugin The plugin that enables
write-set replication service functionality.
• Group Communication plugins The group
communication systems available to Galera Cluster.
15. How does Galera work? 2
Main components (WSREP API)
• Is a generic replication plugin interface for databases
• Database servers have a state
• State refers to the contents of the database
• Changes in the database state as a series of atomic
changes, or transactions
• In a database cluster, all nodes always have the same
state
16. How does Galera work? 3
Main components (Galera Replication Plugin)
The Galera Replication Plugin implements the wsrep API. It operates as
the wsrep provider.
• Certification Layer This layer prepares the write-sets and performs the
certification checks on them, ensuring that they can be applied.
• Replication Layer This layer manages the replication protocol and provides the
total ordering capability.
• Group Communication Framework This layer provides a plugin architecture
for the various group communication systems that connect to Galera Cluster.
17. How does Galera work? 4
Main components (Group communication plugin)
• Implements a virtual synchrony QoS (Quality of Service)
• Implements its own runtime-configurable temporal flow control. Flow
control keeps nodes synchronized to the faction of a second
• Provides a total ordering of messages from multiple sources. It uses this
to generate Global Transaction ID’s in a multi-master cluster
• Is a symmetric undirected graph. All database nodes connect to each
other over a TCP connection
18. What is a Node? 1
• Standard MySQL
Replication
Master
Slave
Slave
• Galera MySQL Replication
Node
Node Node
9cba28fa-a8be-11e4-8f41-9f963e1dbf4f
19. What is a Node? 2
• Standard MySQL
Replication
– Each MySQL instance is
independent
– Data can be different per
node (schema, engine,
content)
• Galera MySQL Replication
– Data is the center
– Nodes connect and share
same data
– Node cannot (should not) be
different, and have the same
STATE
20. What is a Node? 3
• Data is the center
– Data has an UUID =
• 9cba28fa-a8be-11e4-8f41-9f963e1dbf4f
– Data has a Position (seq number)
• wsrep_last_committed | 1398 |
• Position is the same in ANY Synchronized node
– Node has UUID
• 8186a31a-a8bf-11e4-9d19-6bd85d36493b
Node belongs to a cluster/Data and NOT vice versa.
21. What is a Node 4
1. A connecting node talks to one
node in the cluster
2. A DONOR is elected
3. The Donor shares Status and
Starts Synchronization
uuid: 9cba28fa-a8be-11e4-8f41-9f963e1dbf4f
seqno: 1950
New cluster view: global state: 9cba28fa-a8be-11e4-8f41-9f963e1dbf4f:2037,
view# 9: Primary, number of nodes: 5, my index: 2, protocol version 3
22. Segments
• A segment is a logical
grouping of nodes.
• Replication between Segment
is optimized
• Traffic and messaging is
reduced
• In case of SST, the donor is
chosen by proximity
23. Node Status
1. Node connect and
Send status
2. Cluster provides a DONOR
3. Status (data) Exchange
starts (node Joiner)
4. Donor ends transmission,
applies “delta” and rejoins
5. Joiner -> Joined check
seq_num and become Synced
24. Primary Component
Under normal operations, the Primary
Component is the whole cluster.
When cluster partitioning occurs, Galera
Cluster invokes a special quorum algorithm
to select one component as the Primary
Component.
This guarantees that there is never more
than one Primary Component in the cluster.
Primary component
25. Primary Component 2
In case of a network issue, the cluster might
be split.
If the pc.weight and segments are set up
correctly, the nodes in the Non-Primary state
will attempt to rejoin the cluster.
This is an automatic recovery that may
trigger:
• IST
• SST
Primary
Non-Primary
26. Primary Component 3
When the cluster is NOT able to manage
WHO is the primary correctly, a so-called
“split brain” issue may occur.
Split Brain:
• Cannot be automatically recovered from
• Puts all nodes in READ ONLY mode
Non-Primary
Non-Primary
Split Brain
27. Quorum
Quorum can be managed using:
• Pc.weight
• Segments
Segments do not modify the quorum calculation but are
useful to logically group servers.
• Zone 1: Segment=1, weight = 2
• Zone 2: Segment=2, weight = 1
29. Quorum (adv)
Galera organizes the presence/modification of node in
VIEWS:
WSREP: view(view_id(PRIM,28b4b776,78)
memb { 28b4b776,1
79cc1886,1
8637105e,2
f218f33d,2}
joined {} left {}
partitioned { b9aabaa5,1 <--- node is shutting down})
78 is the VIEW number
PRIM define the view as Primary component
Segment identifier
30. Quorum (adv)
Assuming 2 Segments with 3 nodes each
View 1 View 2 View 3
seg weight active
n1 1 1 1
n2 1 1 1
n3 1 1 1
n4 2 1 1
n5 2 1 1
n6 2 1 1
seg weight active
n1 1 1 0
n2 1 1 0
n3 1 1 0
n4 2 1 1
n5 2 1 1
n6 2 1 1
seg weight Active
n1 1 1 1
n2 1 1 1
n3 1 1 1
n4 2 1 0
n5 2 1 0
n6 2 1 0
Segment 2 Quorum 0 Segment 1 Quorum 0
In this case in VIEW 2|3 we will not have a quorum and
the Segments will become NON -PRIMARY
31. Quorum (adv)
Assuming 2 Segments with 3 nodes each
View 1 View 2 View 3
Segment 1 Quorum 1 Segment 2 Quorum 1
Using an arbitrator we can have the quorum.
BUT what if both can access the quorum but not the other segment?
SPLIT BRAIN !!!
seg weight active
n1 1 1 1
n2 1 1 1
n3 1 1 1
n4 2 1 1
n5 2 1 1
n6 2 1 1
n7 3 1 1
seg weight active
n1 1 1 1
n2 1 1 1
n3 1 1 1
n4 2 1 0
n5 2 1 0
n6 2 1 0
n7 3 1 1
seg weight active
n1 1 1 0
n2 1 1 0
n3 1 1 0
n4 2 1 1
n5 2 1 1
n6 2 1 1
n7 3 1 1
32. Quorum (adv)
Assuming 2 Segments with 3 nodes each
View 1 View 2 (1) View 2 (2)
seg weight active
n1 1 4 1/0
n2 1 3 1
n3 1 1 1
n4 2 5 1
n5 2 1 1
n6 2 1 1
seg weight active
n1 1 4 1
n2 1 3 1
n3 1 1 1
n4 2 5 0
n5 2 1 0
n6 2 1 0
seg weight Active
n1 1 4 0
n2 1 3 0
n3 1 1 0
n4 2 5 1
n5 2 1 1
n6 2 1 1
Segment 1 Quorum 1 Segment 2 Quorum 1
In this case in VIEW 2|3 we will have a quorum
• Segment 1 always win and will have the quorum
• Segment 2 will have the quorum in case of planned switch, otherwise NO-PRIMARY
33. Quorum Summary
• Number of Nodes, Even/Odd, not really relevant
• Quorum weight is relevant
• Remind View quorum calculation
• Witness node will NOT guarantee the Split-Brain prevention real node
Should
• HAProxy can help (a lot) to manage Segments
• Plan carefully your cluster, and check View status before mantainance
34. Data Replication (sync)
• On commit, but before commit
• Transaction changes are
ordered by PK and collected in
a write set
• The write set is certified on each
node (including originator) for
apply/reject
• On failure, the originator rolls
back, while others discard the
write set
35. Data Replication (sync)(adv)
Local Certification issues
– Each re-ordered transaction
(deterministic) has a Seq_no
– Galera evaluates all transactions in
the queue from the last successfully
committed
– If another writeset in the queue is
conflicting, then the writeset in
evaluation is discarded, and rolled
back on the originator
– Counter is incremented only on
originator
6 5 4 23 1
Cluster
Commit
Queue
Conflict
5 discarded
wsrep_local_cert_failures
36. Data Replication (sync) (adv)
Local certification issues (2)
– Transaction started, not
committed
– Incoming writeset is applied
– A lock conflict with local
open transaction is raised
– Incoming transaction (write
set) always wins
wsrep_local_bf_aborts
37. Data Replication (sync)
• Certification take place on write-sets
• Each write-set contains references for each
affected key:
– Primary
– Unique
– Foreign key
• Keys are also maintained in a local
certification index for multi-master conflict
resolutions
38. Optimistic & Pessimistic locking
1. The originator has all internal locks
2. Originator ignores other nodes
3. On Commit, it optimistically sends the
modification
4. The write-set is reordered and goes through
a deterministic certification test
5. In the presence of a conflict, the last commit
loses
39. Write-set Cache
GCache A library that provides a transparent on-disk
memory buffer cache.
Its purpose is to allow an (almost) arbitrarily big action cache
without RAM consumption.
Permanent Ring-Buffer File Here, write-sets are pre-
allocated to disk during cache initialization.
40. State Transfer 1
The process of replicating data from the cluster to an
individual node, bringing that node into sync with the cluster.
AKA Provisioning.
Two ways of doing it:
• Incremental State Transfers (IST) Where only the missing
transactions transfer.
• State Snapshot Transfers (SST) Where a snapshot of the
entire node state transfers.
41. State Transfer 2
State transfers always require a:
– Donor
– Joiner
A Joiner is the node that request the ST
Member 0.1 (node3) requested state transfer from 'node5'
A donor is the node Providing the data, donor can be
blocked by getting incoming queries.
42. State Transfer 3
IST Incremental State Transfer, transfer the missing D
between the Joiner and Donor.
• State UUID must be the same as that of the group
• All missing write-sets are available in the donor’s write-set cache
• Much faster and non-blocking operation on the Donor
• IST has a well-known interval:
WSREP: IST request: 9cba28fa-a8be-11e4-8f41-9f963e1dbf4f:77030-
85722|tcp://10.177.128.45:4568
• IST picks the donor that can provide the full WS range (also, if defined,
the donor can change)
43. State Transfer 4
SST State Snapshot Transfer is a full data copy from one
node to another.
This may happen because:
• A New Node joins the cluster
• Enough WS data not present in the Gcache of any Donor
Two approaches:
• Logical (mysqldump; export)
• Physical (rsync; xtrabackup)
44. Flow Control
Galera Cluster manages the replication process using a
feedback mechanism named FLOW CONTROL.
• Allows any node to pause and resume replication
• Prevents any node from lagging too far behind
Modes
– No Flow Control
– Write-set Caching
– Catching Up
– Cluster Sync
45. How Flow Control Works
1. Galera Cluster synchronously replicates write-sets on a
cluster-wide ordering.
2. Transactions received but not yet applied and committed
are placed in the receive queue (wsrep_local_recv_queue)
3. When the size of the queue exceeds the Flow Control Limit,
the node will send a FC pause.
4. When the queue is manageable again (below the limit), the
node removes the pause.
46. Flow Control States 1
Write-set Caching
• Happens when the node is a:
– Joiner
– Donor
• Write-set will be locally cached and applied later
47. Flow Control States 2
Catching up
• Happens when the node is:
– Joined
• Nodes in this state can apply write-sets but are still making up
the gap
• Cluster rate replication is tuned to the Joined Node’s capacity
• Applying a write-set is faster than executing a transaction
• On empty Buffer Pool operations will be slower
48. Flow Control States 3
Cluster Sync
• Happens when the node is:
– Synced
• By far the most common state
• Node enters in FC to limit the receiving queue
• Can be tuned with gcs.fc_limit, gcs.fc_factor
49. Flow Control
How small my fc_limit should be?
• Enough to keep low the delay any node in the cluster
might have when applying cluster transactions
• Enough to keep the certification interval small, which
minimizes replication conflicts on a cluster where writes
happen on all nodes
– A small fc_limit keeps the certification index smaller in memory
50. Manage Flow Control
What to check?
• wsrep_flow_control_sent; wsrep_flow_control_recv;
• wsrep_flow_control_paused; wsrep_flow_control_paused_ns
What can be tuned?
• Replication Rate (expert feature, do not touch)
• Flow control
– gcs.fc_limit (default 16, way too low for every real production)
– gcs.fc_factor (default 1, means resume replication as soon as we
go below fc_limit)
52. Apply DDL
• Any DDL is a non-transactional operation
• Modification raises meta-lock/Server/Schema
In a Galera Cluster, you can choose to run DDL in
• TOI Total Order Isolation
• RSU Rolling Schema Upgrade
• pt-online-schema-change (recommended for large tables)
53. Apply DDL TOI
When using Total Order Isolation, the cluster will work as a
single server until the end of the process on ALL nodes.
Cluster will stay locked:
• Server Level For CREATE SCHEMA, GRANT and similar queries, where the
cluster cannot apply concurrently any other transactions.
• Schema Level For CREATE TABLE and similar queries, where the cluster
cannot apply concurrently any transactions that access the schema.
• Table Level For ALTER TABLE and similar queries, where the cluster cannot
apply concurrently any other transactions that access the table.
54. Apply DDL RSU
When using Rolling Schema Upgrade, each modification will
apply ONLY on the node where the command is executed.
• Different structure between Nodes
• Data inconsistency
• Dangerous use of WSREP_ON
(http://www.tusacentral.net/joomla/index.php/mysql-blogs/168-how-to-mess-up-your-data-using-
one-command-in-mysqlgalera.html)
In short, this is potentially unsafe.
55. Apply DDL PT-OSC
When using pt-online-schema-change, the cluster will block
the nodes for a very short period of time: at the start and at
the end of the process.
• Data is replicated as a normal transaction
• Nodes maintain consistency
• No locking during the copy
• Is recoverable
56. Geographic distribution
Galera Cluster is well suited to cover a geographic
distributed scenario.
• Use a combination of Asynchronous and Synchronous
replication
• Use Master/Slave settings inside Galera
• Use of Segments
57. Galera and Binary logs
Not needed ?
For a long while I stated so, but today I am older and wiser.
• Useful to identify what transaction is a seql_no
• Required when using a slave
• Must have it on at least 2 Nodes when using a slave
• Still an Option in case of DR (trust me I saw it!!)
58. Galera and Binary logs
Understand the differences between
SQL_LOG_BIN & WSREP_ON
• SQL_LOG_BIN will prevent ANY DML to be replicated
NOTE: Standard MySQL exclude DML and DDL
• WSREP_ON will prevent ANY DML & DDL to be replicated
• Use of GLOBAL in this context will cause data inconsistency at 99%
59. What to keep an eye on
As any complex system, Galera Cluster requires your
attention on many areas, the most critical:
• Certification
• Network performance
• Proper schema design (PK/UK/FK)
• Number of nodes (write distribution, not write scaling)
• Correctly plan schema modification
60. Well known Issues
• Foreign Keys
• Small (very small) transactions and highly parallel
committing
• WSREP_ON (global) == SQL_LOG_BIN=0
• Master/Slave is ok, but be careful when using filters
• Locks/Deadlocks can become more frequent
• Network support (documentation)
61. What Next?
Galera Operations:
• Installation, simple and distributed
• Add/remove a node
• Data consistency
• Debug issues using the log
• Data export/Load
• Backups
• Monitoring
63. Thank you
To contact us
sales@pythian.com
1-877-PYTHIAN
To follow us
http://www.pythian.com/blog
http://www.facebook.com/pages/The-Pythian-
Group/163902527671
@pythian
http://www.linkedin.com/company/pythian
To contact Me
tusa@pythian.com
marcotusa@tusacentral.net
To follow me
http://www.tusacentral.net/
https://www.facebook.com/marco.tusa.94
@marcotusa
http://it.linkedin.com/in/marcotusa/