- You should have basic knowledge of mysql.
- OS - Ubuntu
What is Percona?
- Synchronous Replication: Transaction either committed on all nodes or none.
- Multi-Master Replication: You can write to any node
- Parallel applying events on slave. Real “parallel replication”.
- Automatic node provisioning.
- Data consistency. No more unsynchronized slaves.
- The cluster consists of nodes. The cluster’s recommended configuration is to have 3 nodes, however 2 nodes can be used as well.
- 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.
- Each node will contain full copy of data.
Benefits of this approach:
- Whenever you execute a query, it is executed locally. All data is available locally, so no remote access is required.
- No central management. You can loose any node at any time, and cluster will continue functioning.
- It is a good solution for scaling read workload. You can put read queries to any of the nodes.
- 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.
- Not an effective write scaling solution. All writes have to go on all nodes.
- Duplication of data. If you have 3 nodes, there will be 3 duplicates.
Difference between Percona XtraDB Cluster and MySQL Replication
- MySQL replication has: Availability and Partitioning tolerance.
- Percona XtraDB Cluster has: Consistency and Availability.
- Percona Server with XtraDB and includes Write Set Replication patches.
- Galera Library: A generic synchronous Multi-Master replication plugin for transactional applications.
- Galera supports:
- Incremental State Transfer (IST), useful in WAN deployments.
- RSU, Rolling Schema Update. Schema change does not block operations against table.
Percona XtraDB cluster limitations
- Currently replication work only with InnoDB storage engine.
- Unsupported queries:
- LOCK/UNLOCK tables
- lock function (GET_LOCK(), RELEASE_LOCK()....)
- Due to cluster level concurrency control, transaction issuing COMMIT may be aborted at that stage.
- The write throughput of whole cluster is limited by weakest node. If one node becomes slow, whole cluster will become slow.
- State Snapshot Transfer (SST): SST method performs full copy of data from one node to other. It’s used when a new node joins the cluster. One of the existing node will transfer data to it.
There are three available methods of SST:
- Incremental State Transfer (IST): 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.
- 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.
- 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.
Let me know if you have any suggestions. You can also contact me at firstname.lastname@example.org.