{"id":392,"date":"2015-02-23T05:19:00","date_gmt":"2015-02-23T05:19:00","guid":{"rendered":"https:\/\/opstree.com\/blog\/\/2015\/02\/23\/understanding-percona-xtradb-cluster\/"},"modified":"2019-09-18T14:12:26","modified_gmt":"2019-09-18T08:42:26","slug":"understanding-percona-xtradb-cluster","status":"publish","type":"post","link":"https:\/\/opstree.com\/blog\/2015\/02\/23\/understanding-percona-xtradb-cluster\/","title":{"rendered":"Understanding Percona XtraDB cluster"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align:left;\">\n<div style=\"line-height:1.38;margin-bottom:0;margin-top:0;text-align:left;\">\n<div style=\"text-align:left;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\">As a DevOps activist I am exploring Percona XtraDB. In a series of blogs I will share my learnings. This blog intends to capture theoretical knowledge of Percona XtraDB Cluster.<\/span><\/span><br \/>\n<span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><br \/>\n<\/span><\/span><\/div>\n<\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\">\n<h2 style=\"text-align:left;\"><span style=\"font-size:large;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Prerequisites<\/span><\/span><\/span><\/h2>\n<\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\">\n<ol style=\"text-align:left;\">\n<li><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">You should have basic knowledge of mysql.\u00a0<\/span><\/span><\/span><\/li>\n<li><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">OS &#8211; Ubuntu<\/span><\/span><\/span><\/li>\n<\/ol>\n<\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\">\n<h3 style=\"text-align:left;\"><span style=\"font-size:large;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">What is Percona?<\/span><\/span><\/span><\/h3>\n<\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Percona XtraDB cluster is an open source, free MySql high availability and scalability software.<\/span><\/span><\/span><\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">It provides:<\/span><\/span><\/span><\/div>\n<ol style=\"margin-bottom:0;margin-top:0;\">\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:decimal;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Synchronous Replication: Transaction either committed on all nodes or none.<\/span><\/span><\/span><\/div>\n<\/li>\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:decimal;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Multi-Master Replication: You can write to any node<\/span><\/span><\/span><\/div>\n<\/li>\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:decimal;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Parallel applying events on slave. Real \u201cparallel replication\u201d.<\/span><\/span><\/span><\/div>\n<\/li>\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:decimal;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Automatic node provisioning.<\/span><\/span><\/span><\/div>\n<\/li>\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:decimal;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Data consistency. No more unsynchronized slaves. <\/span><\/span><\/span><\/div>\n<\/li>\n<\/ol>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\">\n<h3 style=\"text-align:left;\"><span style=\"font-size:large;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\"><br \/>\nIntroduction<\/span><\/span><\/span><\/h3>\n<\/div>\n<ol style=\"margin-bottom:0;margin-top:0;\">\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:decimal;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">The cluster consists of nodes. The cluster\u2019s recommended configuration is to have 3 nodes, however 2 nodes can be used as well.<\/span><\/span><\/span><\/div>\n<\/li>\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:decimal;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Every node is a regular Mysql \/ Percona server setup. You can convert your existing MySQL \/ Percona Server into Node and roll Cluster using it as a base or you can detach Node from Cluster and use it as a regular server.<\/span><\/span><\/span><\/div>\n<\/li>\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:decimal;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Each node will contain full copy of data.<\/span><\/span><\/span><\/div>\n<\/li>\n<\/ol>\n<p><b style=\"font-weight:normal;\"> <\/b><b style=\"font-weight:normal;\"><img decoding=\"async\" style=\"-webkit-transform:rotate(0.00rad);border:none;transform:rotate(0.00rad);\" src=\"https:\/\/lh5.googleusercontent.com\/zA02v6-5RkgQQNqNMBGlW_IUm3Z5kebCJZyKlekboDvXBtFGw2RmgpzM5aZVCiNFO7BRjZqncE22d9DIv-pds4ZmLKyTl8TyXJvUwGwmVmq6vGMmZ-muPuuycMcm9zPKSes\" alt=\"percona.jpeg.jpg\" width=\"624px;\" height=\"336px;\" \/><\/b><\/p>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\">\n<h4 style=\"text-align:left;\"><span style=\"font-size:large;\"><span style=\"font-family:inherit;\"><b> <\/b><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Benefits of this approach:<\/span><\/span><\/span><\/h4>\n<\/div>\n<ul style=\"margin-bottom:0;margin-top:0;text-align:left;\">\n<li><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"line-height:1.38;white-space:pre-wrap;\">Whenever you execute a query, it is executed locally. All data is available locally, so no remote access is required.<\/span><\/span><\/span><\/li>\n<li><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"line-height:1.38;white-space:pre-wrap;\">No central management. You can loose any node at any time, and cluster will continue functioning.<\/span><\/span><\/span><\/li>\n<li><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"line-height:1.38;white-space:pre-wrap;\">It is a good solution for scaling read workload. You can put read queries to any of the nodes.<\/span><\/span><\/span><\/li>\n<\/ul>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\">\n<h4 style=\"text-align:left;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><br \/>\n<span style=\"font-size:large;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Drawbacks:<\/span><\/span><\/span><\/span><\/span><\/h4>\n<\/div>\n<ul style=\"margin-bottom:0;margin-top:0;\">\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:disc;margin-left:16px;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Overhead of joining new node. New node will copy all data from an existing node. If it is 100 GB, it will copy 100 GB.<\/span><\/span><\/span><\/div>\n<\/li>\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:disc;margin-left:16px;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Not an effective write scaling solution. All writes have to go on all nodes.<\/span><\/span><\/span><\/div>\n<\/li>\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:disc;margin-left:16px;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Duplication of data. If you have 3 nodes, there will be 3 duplicates.<\/span><\/span><\/span><\/div>\n<\/li>\n<\/ul>\n<h3 style=\"text-align:left;\"><span style=\"font-family:inherit;font-size:large;line-height:1.38;white-space:pre-wrap;\">Difference between Percona XtraDB Cluster and MySQL Replication<\/span><\/h3>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:10pt;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">For this we will have to look into the well known CAP theorem for distributed systems. According to this theorem, characteristics of Distributed systems are:<\/span><\/span><\/span><\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"> <span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\"> C &#8211; Consistency (all your data is consistent on all nodes),<\/span><\/span><\/span><\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-left:36pt;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">A &#8211; Availability (your system is AVAILABLE to handle requests in case of failure of one or several nodes),<\/span><\/span><\/span><\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:10pt;margin-left:36pt;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">P &#8211; Partitioning tolerance (in case of inter-node connection failure, each node is still available to handle requests).<\/span><\/span><\/span><\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">CAP theorem says that any Distributed system can have any two out of these three.<\/span><\/span><\/span><\/div>\n<ul style=\"margin-bottom:0;margin-top:0;\">\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:disc;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">MySQL replication has: Availability and Partitioning tolerance.<\/span><\/span><\/span><\/div>\n<\/li>\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:disc;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Percona XtraDB Cluster has: Consistency and Availability.<\/span><\/span><\/span><\/div>\n<\/li>\n<\/ul>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">So, MySql replication does not guarantee Consistency of data, while Percona XtraDB cluster provides consistency while it looses partitioning tolerance.<\/span><\/span><\/span><br \/>\n<span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\"><br \/>\n<\/span><\/span><\/span><\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:10pt;margin-top:0;\">\n<h3 style=\"text-align:left;\"><span style=\"font-size:large;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Components<\/span><\/span><\/span><b><span style=\"font-size:large;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">\u00a0<\/span><\/span><\/span><\/b><\/h3>\n<div style=\"text-align:left;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Percona XtraDb Cluster is based on:<\/span><\/span><\/span><\/div>\n<\/div>\n<ul style=\"margin-bottom:0;margin-top:0;\">\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:disc;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Percona Server with XtraDB and includes Write Set Replication patches.<\/span><\/span><\/span><\/div>\n<\/li>\n<\/ul>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">It uses:<\/span><\/span><\/span><\/div>\n<ul style=\"margin-bottom:0;margin-top:0;\">\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:disc;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Galera Library: A generic synchronous Multi-Master replication plugin for transactional applications.<\/span><\/span><\/span><\/div>\n<\/li>\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:disc;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Galera supports:<\/span><\/span><\/span><\/div>\n<ul style=\"margin-bottom:0;margin-top:0;\">\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:circle;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Incremental State Transfer (IST), useful in WAN deployments.<\/span><\/span><\/span><\/div>\n<\/li>\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:circle;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">RSU, Rolling Schema Update. Schema change does not block operations against table.<\/span><\/span><\/span><\/div>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<div><span style=\"white-space:pre-wrap;\">\u00a0<\/span><\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\">\n<h3 style=\"text-align:left;\"><span style=\"font-size:large;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Percona XtraDB cluster limitations<\/span><\/span><\/span><\/h3>\n<\/div>\n<ul style=\"margin-bottom:0;margin-top:0;\">\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:disc;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Currently replication work only with InnoDB storage engine.<\/span><\/span><\/span><\/div>\n<\/li>\n<\/ul>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-left:36pt;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">That means writes to table of other types, including (mysql.*) tables, are not replicated.<\/span><\/span><\/span><\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-left:36pt;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">DDL statements are replicated in statement level and changes to mysql.* tables will get replicated that way.<\/span><\/span><\/span><\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-left:36pt;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">So you can issue: CREATE USER \u2026. , this will be replicated,<\/span><\/span><\/span><\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-left:36pt;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">but issuing: INSERT INTO mysql.user \u2026. , will not be replicated.<\/span><\/span><\/span><\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-left:36pt;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">You can also enable experimental MyISAM replication support with <\/span><span style=\"background-color:transparent;color:#6fa8dc;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">wsrep_replicate_myisam<\/span><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">.<\/span><\/span><\/span><\/div>\n<ul style=\"margin-bottom:0;margin-top:0;\">\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:disc;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Unsupported queries:<\/span><\/span><\/span><\/div>\n<ul style=\"margin-bottom:0;margin-top:0;\">\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:circle;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">LOCK\/UNLOCK tables<\/span><\/span><\/span><\/div>\n<\/li>\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:circle;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">lock function (GET_LOCK(), RELEASE_LOCK()&#8230;.)<\/span><\/span><\/span><\/div>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul style=\"margin-bottom:0;margin-top:0;\">\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:disc;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Due to cluster level concurrency control, transaction issuing COMMIT may be aborted at that stage.<\/span><\/span><\/span><\/div>\n<\/li>\n<\/ul>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-left:36pt;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">There can be two transactions writing to same rows and committing in separate Percona XtraDB Cluster nodes, and only one of the them can successfully commit. The failing one will be aborted. For cluster level aborts, Percona will give back deadlock error code.<\/span><\/span><\/span><\/div>\n<ul style=\"margin-bottom:0;margin-top:0;\">\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:disc;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">The write throughput of whole cluster is limited by weakest node. If one node becomes slow, whole cluster will become slow.<\/span><\/span><\/span><\/div>\n<\/li>\n<\/ul>\n<div><span style=\"white-space:pre-wrap;\">\u00a0<\/span><\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\">\n<h3 style=\"text-align:left;\"><span style=\"font-size:large;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">FEATURES<\/span><\/span><\/span><\/h3>\n<\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\">\n<h4 style=\"text-align:left;\"><b><span style=\"font-family:inherit;\"><span style=\"font-size:small;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">High Availability<\/span><\/span><\/span><\/b><\/h4>\n<\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">In a basic setup with 3 nodes, the Percona XtraDB cluster will continue to function if you take any of the nodes down. Even in a situation of node crash, or if node becomes unavailable over network, the cluster will continue to work, and queries can be issued on working nodes.<\/span><\/span><\/span><\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">In case, when there are changes in data while node was down, there are two options that Node may use when it joins the cluster:<\/span><\/span><\/span><\/div>\n<ol style=\"margin-bottom:0;margin-top:0;\">\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:decimal;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:italic;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">State Snapshot Transfer (SST): <\/span><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">SST method performs full copy of data from one node to other. It\u2019s used when a new node joins the cluster. One of the existing node will transfer data to it.<\/span><\/span><\/span><br \/>\n<span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">\u00a0<\/span><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">There are three available methods of SST:<\/span><\/span><\/span><\/div>\n<\/li>\n<\/ol>\n<ul style=\"margin-bottom:0;margin-top:0;text-align:left;\">\n<li style=\"list-style-type:none;\">\n<ul>\n<li><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"line-height:1.38;white-space:pre-wrap;\">mysqldump<\/span><\/span><\/span><\/li>\n<li><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"line-height:1.38;white-space:pre-wrap;\">rsync<\/span><\/span><\/span><\/li>\n<li><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"line-height:1.38;white-space:pre-wrap;\">xtrabackup<\/span><\/span><\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-left:36pt;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Downside of \u201cmysqldump\u201d and \u201crsync\u201d is that your cluster becomes READ-ONLY while data is copied from one node to other.<\/span><\/span><\/span><\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-left:36pt;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">while<\/span><\/span><\/span><\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-left:36pt;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">xtrabackup SST does not require this for entire syncing process.<\/span><\/span><\/span><\/div>\n<ol style=\"margin-bottom:0;margin-top:0;\" start=\"2\">\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:decimal;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"> <span style=\"background-color:transparent;color:black;font-style:italic;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Incremental State Transfer (IST):<\/span><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\"> If a node is down for a short period of time, and then starts up, the node is able to fetch only those changes made during the period it was down.<\/span><\/span><\/span><\/div>\n<\/li>\n<\/ol>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-left:36pt;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">This is done using caching mechanism on nodes. Each node contains a cache, ring-buffer of last N changes, and the node is able to transfer part of this cache. IST can be done only if the amount of changes needed to transfer is less than N. If it exceeds N, then the joining node has to perform SST.<\/span><\/span><\/span><\/span><\/p>\n<\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\">\n<h4 style=\"text-align:left;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:bold;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Multi-Master Replication<\/span><\/span><\/span><\/h4>\n<\/div>\n<ul style=\"margin-bottom:0;margin-top:0;\">\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:disc;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">Multi-Master replication stands for the ability to write to any node in the cluster, and not to worry that it will get out-of-sync situation, as it regularly happens with regular MySQL replication if you imprudently write to the wrong server.<\/span><\/span><\/span><\/div>\n<\/li>\n<li style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;list-style-type:disc;text-decoration:none;vertical-align:baseline;\">\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\">With Percona XtraDB Cluster you can write to any node, and the Cluster guarantees consistency of writes. That is, the write is either committed on all the nodes or not committed at all.<\/span><\/span><\/span><\/div>\n<\/li>\n<\/ul>\n<div><span style=\"font-family:inherit;line-height:1.38;white-space:pre-wrap;\">All queries are executed locally on the node, and there is a special handling only on COMMIT. When the COMMIT is issued, the transaction has to pass certification on all the nodes. If it does not pass, you will receive ERROR as a response on that query. After that, transaction is applied on the local node.<\/span><\/div>\n<div dir=\"ltr\" style=\"line-height:1.38;margin-bottom:0;margin-top:0;\"><span style=\"font-size:small;\"><span style=\"font-family:inherit;\"><span style=\"background-color:transparent;color:black;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;\"><br \/>\n<\/span><\/span><\/span><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>As a DevOps activist I am exploring Percona XtraDB. In a series of blogs I will share my learnings. This blog intends to capture theoretical knowledge of Percona XtraDB Cluster. Prerequisites You should have basic knowledge of mysql.\u00a0 OS &#8211; Ubuntu What is Percona? Percona XtraDB cluster is an open source, free MySql high availability &hellip; <a href=\"https:\/\/opstree.com\/blog\/2015\/02\/23\/understanding-percona-xtradb-cluster\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Understanding Percona XtraDB cluster&#8221;<\/span><\/a><\/p>\n","protected":false},"author":171775670,"featured_media":29900,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[28070474,11987323],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2025\/11\/DevSecOps-1.jpg","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pfDBOm-6k","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/392"}],"collection":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/users\/171775670"}],"replies":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/comments?post=392"}],"version-history":[{"count":4,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/392\/revisions"}],"predecessor-version":[{"id":1337,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/392\/revisions\/1337"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media\/29900"}],"wp:attachment":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media?parent=392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/categories?post=392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/tags?post=392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}