Percona XtraDB Cluster powered by Galera Vadim Tkachenko Percona Inc, co-founder, CTO www.percona.com www.mysqlperformanceblog.com
Percona XtraDB Cluster
This talk online • PowerPoint • http://bit.ly/PXC-meetup • PDF • http://bit.ly/PXC-meetup-pdf • Google Docs • http://bit.ly/PXC-meetup-gdocs
Percona XtraDB Cluster
This talk
Percona XtraDB Cluster
What is HA
Percona XtraDB Cluster
Availability by redundancy
Percona XtraDB Cluster
Duplicate resources
Percona XtraDB Cluster
Failover
Percona XtraDB Cluster
Percona XtraDB Cluster
Probability of failure
Percona XtraDB Cluster
Easy ? Not if we deal with databases
Percona XtraDB Cluster
Database
Percona XtraDB Cluster
Redundancy ?
Percona XtraDB Cluster
Database availability is hard
Percona XtraDB Cluster
Replication
Percona XtraDB Cluster
Percona XtraDB Cluster
What is wrong with MySQL replication ?
Percona XtraDB Cluster
What is wrong with MySQL replication ?
Percona XtraDB Cluster
What is wrong with MySQL replication ?
Percona XtraDB Cluster
Async
Percona XtraDB Cluster
Async
Percona XtraDB Cluster
sync
Percona XtraDB Cluster
Didn’t we just reinvent DRBD ?
Percona XtraDB Cluster
DRBD
Percona XtraDB Cluster
Clustering
Percona XtraDB Cluster
Percona XtraDB Cluster Free and Open Source
Percona XtraDB Cluster
Percona XtraDB Cluster
Percona XtraDB Cluster
Virtually synchronous http://en.wikipedia.org/wiki/Virtual_synchrony
Percona XtraDB Cluster
Virtually synchronous
Percona XtraDB Cluster
Percona XtraDB Cluster
Percona XtraDB Cluster
Multi-master: MySQL
Percona XtraDB Cluster
Multi-master: XtraDB Cluster
Percona XtraDB Cluster
Percona XtraDB Cluster
Parallel apply: MySQL
Percona XtraDB Cluster
Parallel apply: XtraDB Cluster
Percona XtraDB Cluster
Percona XtraDB Cluster
XtraDB Cluster data consistency
Percona XtraDB Cluster
Percona XtraDB Cluster
Node provisioning
Percona XtraDB Cluster
CAP theorem http://en.wikipedia.org/wiki/CAP_theorem
Percona XtraDB Cluster
Pick only TWO
Percona XtraDB Cluster
Network failure
Percona XtraDB Cluster
MySQL Replication Access to all systems - YES Data consistency - NO
Percona XtraDB Cluster
XtraDB Cluster Access to all systems - NO Data consistency - YES
Percona XtraDB Cluster
3 nodes is the minimal recommended configuration
Percona XtraDB Cluster
Split brain
Which system to make available ?
Percona XtraDB Cluster
Split brain
You still can have this setup But you deal with consequences
Percona XtraDB Cluster
Choice MySQL Replication: Access to all systems
XtraDB Cluster: Data consistency
Percona XtraDB Cluster
Percona XtraDB Cluster
Percona XtraDB Cluster details
Percona XtraDB Cluster
Percona XtraDB Cluster
Percona XtraDB Cluster
Percona XtraDB Cluster
Percona XtraDB Cluster
So, is this a perfect solution?
Percona XtraDB Cluster
Limitations some will be solved later
Percona XtraDB Cluster
Only InnoDB tables are supported
Percona XtraDB Cluster
OPTIMISTIC locking for transactions on different servers http://en.wikipedia.org/wiki/Optimistic_concurrency_control
Percona XtraDB Cluster
Traditional locking
Percona XtraDB Cluster
Optimistic locking
Percona XtraDB Cluster
The write performance is limited by weakest node
Percona XtraDB Cluster
Write performance
Percona XtraDB Cluster
For write intensive applications there could be datasize limit per node Not physical but logical
Percona XtraDB Cluster
Join process. Step 1
Percona XtraDB Cluster
Join process. Step 2
Percona XtraDB Cluster
Join process: step 3
Percona XtraDB Cluster
This is software + hardware solution
Percona XtraDB Cluster
InnoDB write performance
Percona XtraDB Cluster
InnoDB performance + ACID
Percona XtraDB Cluster
Cluster performance
Percona XtraDB Cluster
Join process
Percona XtraDB Cluster
State Transfer
Percona XtraDB Cluster
Snapshot State Transfer
Percona XtraDB Cluster
Incremental State Transfer
Percona XtraDB Cluster
Scaleability
Percona XtraDB Cluster
Percona XtraDB Cluster
Scaleability is similar to availability
Percona XtraDB Cluster
XtraDB Cluster: Reads scalability is easy
Percona XtraDB Cluster
Write scalability is complicated
Percona XtraDB Cluster
N servers scale to :
Percona XtraDB Cluster
10 servers scale to :
Percona XtraDB Cluster
FAQ Questions I am asked
Percona XtraDB Cluster
It looks so easy. Why did not you implement it earlier? It is not easy. Computer science of group communication and distributed transactions. Credits to Codership Oy
Percona XtraDB Cluster
How fast is it? Reasonably fast.
Percona XtraDB Cluster
Can I replicate XtraDB Cluster to MySQL Replication? Yes
Percona XtraDB Cluster
Async MySQL Replication
Percona XtraDB Cluster
Would I install it on a production system? Yes. I am going to upgrade MySQLPerformanceBlog.com to use XtraDB Cluster
Percona XtraDB Cluster
How it is compared to MySQL Cluster? It is different
Percona XtraDB Cluster
XtraDB Cluster Easy to migrate Easy to use Cloud / EC2 Changes in an application Write scaling 99.999%
MySQL Cluster
Percona XtraDB Cluster
Resources • http://www.percona.com/software/percona-xtradb-cluster/ • http://www.codership.com/wiki/doku.php • Virtual synchrony • http://en.wikipedia.org/wiki/Virtual_synchrony • CAP Theorem • http://en.wikipedia.org/wiki/CAP_theorem • Optimistic locking • http://en.wikipedia.org/wiki/Optimistic_concurrency_control
Percona XtraDB Cluster
Credits • WSREP patches and Galera library is developed by Codership
Oy
Percona XtraDB Cluster
Thank you!