Percona XtraDB Cluster ( Ensure high Availability )

MyDBOPS 2,050 views 35 slides Oct 17, 2017
Slide 1
Slide 1 of 35
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35

About This Presentation

It was presented on OSI days 2017 at Bangalore. This talk focus on XtraDB Cluster architecture and its improvements in latest MySQL 5.7.


Slide Content

www.mydbops.com [email protected]
Presenter

Karthik P R
CEO Mydbops
Percona XtraDB Cluster
Ensure High Availability

Mydbops is into MySQL/MongoDB Support and Consulting. It is founded by experts
who have scaled database at Yahoo! ,Percona and Datavail. We are providing an
expert level support and 24*7 monitoring for MySQL databases and its related
technologies like MariaDB , Percona ( also clustering ) . We support modern
database technologies in MySQL which includes Galera ( Clustering ), Group
Replication , SQL aware Load balancers like Maxscale / ProxySQL.



Mydbops

www.mydbops.com [email protected]
Our Clients

CEO / DB Architect


About Me

1.Native MySQL Replication
2.Percona XtraDB Cluster
3.What is new in XtraDB Cluster ?
4.Load Balancing
5.Use Cases
6.Limitations




Table of Contents

1.Native MySQL Replication
2.Percona XtraDB Cluster
3.What is new in XtraDB Cluster ?
4.Load Balancing
5.Use Cases
6.Limitations




Table of Contents

•One of Best Feature in MySQL from start.
•Asynchronous in nature.
•Binary log based replication.
•Data is streamed between nodes.
•Works irrespective of MySQL Engine used.





Native MySQL Replication

•Can have any kind of topology and any levels






Native MySQL Replication

•Slaves helps in the read scalability.
○Asynchronous Replication ( lag )
○Data loss and data inconsistency
○ Parallelism.
■5.6 = Database level
■5.7 = Time based group
■8.0 = Writeset ( RC )






Native MySQL Replication

•Replication Switchover and Failover
○Externals scripts for failover.
○GTID 5.6 and Orchestrator makes things better.
•Adding a slave (node)
○Backup and restore.
○Manual config of slave coordinates.






Native MySQL Replication

1.Native MySQL Replication
2.Percona XtraDB Cluster
3.What is new in XtraDB Cluster ?
4.Load Balancing
5.Use Cases
6.Limitations




Table of Contents

Percona XtraDB Cluster is an active/active
high availability and high scalability open source
solution for MySQL.Percona XtraDB Cluster 5.7
is MySQL 5.7 compatible Galera-based high
availability (HA) solution.


Tightly integrated with Xtrabackup and ProxySQL for scalability. Heavily tested for
production workload and has a huge share in MySQL clustering solution & Openstack for
RDBMS.







Percona XtraDB Cluster

What is Galera ?
Galera is a replication plugin for the synchronous replication and multi master replication to
achieve High Availability. The read and writes can be made on any node and there is no
complex failover solutions. An open source from codership team.

What is wsrep ?

WSREP (Write Set REPlication) is an API to connect the Galera library and control the
characteristics of Galera.It helps to implement the Certificate based replication and multi
master replication.
Percona XtraDB Cluster

Features

●Synchronous Replication ( Virtually )
●Parallel applier threads
●Quorum based
●Automatic node provisioning
●Multi master writes
●PXC Specific features






Percona XtraDB Cluster

Transaction in Galera







Percona XtraDB Cluster

Transaction in Galera






Percona XtraDB Cluster

Percona XtraDB Cluster - Setup






Group Communication

Percona XtraDB Cluster

Parallel Appliers
●Write set consists only rows to replicate.
●Any transaction which writes different tuples can be parallelized.
●wsrep_slave_threads controls parallel threads









Percona XtraDB Cluster
Application Writes

Replication Writes

Percona XtraDB Cluster
Recovery
IST
(Incremental State
Transfer)
SST
(State Snapshot
Transfer)
●Disconnected for
maintenance

●Node crashed
●Joining a new node

●Node disconnected
for a long time

1.Native MySQL Replication
2.Percona XtraDB Cluster
3.What is new in XtraDB Cluster ?
4.Load Balancing
5.Use Cases
6.Limitations




Table of Contents

●Improved scalability by 10x.
●Tracking IST Progress
●Gcache Recovery
●PXC_Strict_mode
●Performance Schema for Galera
●Securing PXC
What is new in XtraDB Cluster ?

What is new in XtraDB Cluster ?
Improved XtraDB Cluster Scalability

What is new in XtraDB Cluster ?
IST Improvements

●Gcache Recovery ( Codership )
Gcache can be made to disk with gcache.recover=yes it helps in restoring cache on
restore.It saves pains in SST.

●PXC_strict_mode
PXC Strict Mode is designed to avoid the use of experimental and unsupported features in
Percona XtraDB Cluster. It includes storage engine checks, Primary key checks, binlog format ,
Autoinc lock mode and others.
What is new in XtraDB Cluster ?

1.Native MySQL Replication
2.Percona XtraDB Cluster
3.What is new in XtraDB Cluster ?
4.Load Balancing
5.Use Cases
6.Limitations




Table of Contents

●Load balancer for MySQL
○HAProxy ( TCP Layer )
○Maxscale ( Application Layer )
○ProxySQL ( Application Layer )

●SQL aware load balancer (application layer) , forward the queries/statements by
understanding the underlying state of PXC.
○Read-write split up
○Automatic Switchover




Load Balancing

●ProxySQL is light weight
●Build by René Cannaò
●GPL V3 License
●SQL based administration
●Custom cluster health check script
●Proxysql-admin for easy configuration.
●ProxySQL 1.4 comes with inbuilt clustering
Load Balancing ( ProxySQL )

●Maxscale Build by MariaDB
●File based config
●Pluggable Router
●GPL and BSL model
○Maxscale 1.4 (GPL)
○Maxscale 2.X (BSL)
Load Balancing ( Maxscale )

1.Native MySQL Replication
2.Percona XtraDB Cluster
3.What is new in XtraDB Cluster ?
4.Load Balancing
5.Use Cases
6.Limitations




Table of Contents

●High Availability
○Quorum
○Automated Failover
●Read Scaling ( No write scaling )
○No read-write split required
○Read throughput increased with nodes
●WAN Based Replication.
○Optimized WAN segments
Use cases

Sample Architecture ( 3 node + 2 node ProxySQL )

Use cases

1.Native MySQL Replication
2.Percona XtraDB Cluster
3.What is new in XtraDB Cluster ?
4.Load Balancing
5.Use Cases
6.Limitations




Table of Contents

●Supports Only InnoDB Engine.
●Tables should have Primary Key ( else created internally )
●All nodes should have same capacity.
●Avoid heavier and longer transaction ( OLTP workload )
●Schema changes are costly ( use pt-osc )
●Needs a Stable and strong network.
Limitations

●Percona XtraDB Cluster Official website
○https://www.percona.com/doc/percona-xtradb-cluster/
●Percona XtraDB Blogs
○https://www.percona.com/blog/category/percona-xtradb-cluster/
Resources

www.mydbops.com [email protected]
Contact US:
Write to me at [email protected]

DB Consulting Contact : [email protected]

Phone : 08048505683