Galera cluster - SkySQL Paris Meetup 17.12.2013
-
Upload
skysql-ab -
Category
Technology
-
view
122 -
download
4
description
Transcript of Galera cluster - SkySQL Paris Meetup 17.12.2013
![Page 1: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/1.jpg)
Codership is there to secure our customers’ invaluable data. We do this by providing high availability, no-data-loss and
scalable data replication and clustering solutions for open source databases.
![Page 2: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/2.jpg)
2www.codership.com
What is the Meaning of Galera ?
Turns out it has different semantics in:● Italy● Uruguay● Brazil● Spain, Portugal, Russia...
![Page 3: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/3.jpg)
3www.codership.com
Galera in Italy
Che cosa significa la parola galera?
Jail / Prison
![Page 4: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/4.jpg)
4www.codership.com
Galera in Uruguay
Que significaca galera en Uruguai?
Traditional tall hat
![Page 5: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/5.jpg)
5www.codership.com
Galera in Brazil
A Group of Happy People
![Page 6: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/6.jpg)
![Page 7: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/7.jpg)
7www.codership.com
Galera in Spain, Portugal, Russia...
Galley
![Page 8: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/8.jpg)
8www.codership.com
Asynchronous Replication
Can be a mess....
![Page 9: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/9.jpg)
9www.codership.com
Synchronous Replication
That's more like it !!
![Page 10: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/10.jpg)
10www.codership.com
MariaDB
Synchronous Multi-Master Replication
Galera Replication
![Page 11: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/11.jpg)
11www.codership.com
MariaDB MariaDB
Synchronous Multi-Master Replication
Galera Replication
There can be several nodes
![Page 12: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/12.jpg)
12www.codership.com
MariaDB MariaDB MariaDB
Synchronous Multi-Master Replication
Galera Replication
There can be several nodes
Nodes can be added on the fly
![Page 13: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/13.jpg)
13www.codership.com
MySQL MySQL MySQL
Synchronous Multi-Master Replication
Galera Replication
Client can connect to any node
There can be several nodes
Nodes can be added on the fly
![Page 14: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/14.jpg)
14www.codership.com
MariaDB MariaDB MariaDB
Synchronous Multi-Master Replication
Galera Replication
Client can connect to any node
There can be several nodes
read & write read & write read & write Read & write access to any node
Nodes can be added on the fly
![Page 15: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/15.jpg)
15www.codership.com
MariaDB MariaDB MariaDB
Synchronous Multi-Master replication
Galera ReplicationReplication is synchronous
read & write read & write read & write
Client can connect to any node
Each node have identical data
Read & write access to any node
Add nodes on the fly
There can be several nodes
![Page 16: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/16.jpg)
16www.codership.com
MariaDB
Multi-Master Replication
Multi-master cluster looks like one big database with multiple entry points
read & write read & write read & write
![Page 17: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/17.jpg)
17www.codership.com
MariaDB MariaDB MariaDB
Synchronous Replication
aGalera Replication
Read & write
Transaction is processed locally up to commit time
![Page 18: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/18.jpg)
18www.codership.com
MariaDB MariaDB MariaDB
Synchronous Replication
Galera Replication
commit
Transaction's write set is replicated to whole cluster
Slave queueSlave queue
![Page 19: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/19.jpg)
19www.codership.com
Galera Replication
MariaDB MariaDB MariaDB
Synchronous Replication
OK
Client gets OK status
Slave queueSlave queue
![Page 20: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/20.jpg)
20www.codership.com
Galera Replication
MariaDB MariaDB MariaDB
Synchronous Replication
Transaction is applied in slaves
Slave queueSlave queue
![Page 21: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/21.jpg)
21www.codership.com
MariaDB MariaDB MariaDB
How node failures are handled
a
Galera Replication
Load Balancing
![Page 22: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/22.jpg)
22www.codership.com
MariaDB MariaDB MariaDB
Quorum, handling the failure
a
Galera Replication
Load Balancing
● Galera uses quorum based failure handling:
– When cluster partitioning is detected, the majority partition "has quorum" and can continue
– A minority partition cannot commit transactions, but will attempt to re-connect to primary partition
– Note: 50% is not majority!=> Minimum 3 nodes recommended.
● Load balancer will notice errors & remove node from pool
![Page 23: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/23.jpg)
23www.codership.com
Galera ReplicationA
Optimistic Concurrency Control
commit
Trx A
B
commit
Trx B
![Page 24: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/24.jpg)
24www.codership.com
Optimistic Concurrency Control
●Transactions process independently in each cluster node
●Transaction write sets will be replicated at commit time (before commit)
●Cluster wide conflicts will be resolved and conflict victim must rollback
Optimistic Concurrency Control
![Page 25: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/25.jpg)
25www.codership.com
MariaDB
Parallel Replication
Slave queue
Slave thd Slave thd
Slave control
Any number of slave applier threads can be started
Slave control assigns write sets for slave appliers
Slave control is on ROW level
Only applying is parallel, commit order is dictated
![Page 26: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/26.jpg)
26www.codership.com
Galera Cluster benefits
➢ Synchronous multi-master cluster➢ no data loss➢ no slave lag➢ No complex slave failover
➢ For MySQL/MariaDB InnoDB➢ No single point of failure
![Page 27: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/27.jpg)
27www.codership.com
Galera Cluster benefits
➢ Good Performance and scalability➢ Optimistic concurrency control➢ Parallel Replication➢ Optimized Group Communication
➢ 99.99% transparent➢ InnoDB look & feel
➢ Automatic node joining➢ Works in LAN / WAN / Cloud
![Page 28: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/28.jpg)
28www.codership.com
Codership Company
● Established 2007 ● Three MySQL Clusters before Galera
Cluster● Open source + support sales● Active community, hundreds of users● Latest release 3.1 Galera Cluster● MariaDB Galera Cluster 5.5.33
![Page 29: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/29.jpg)
29
Who is using Galera?
![Page 30: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/30.jpg)
Mercadolibre OpenStack Galera deployment
If you live in Latin America (and even if you don't) you most likely know the online trading platform
MercadoLibre. MercadoLibre is where 58 million consumers in Argentina, Brazil, Chile, Colombia,
Ecuador, Mexico, Peru, Uruguay, and Venezuela go to buy and sell. Among the world's e-commerce market
leaders, MercadoLibre was recognized in 2010 as one of the top 30 world's hottest brands.
![Page 31: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/31.jpg)
31www.codership.com
Galera Project
MySQL
MariaDBmerge
merge
MySQL Community Edition
MariaDBGalera Cluster for MySQL
MariaDB FeaturesAPI
MySQL
Galera Replication plugin
![Page 32: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/32.jpg)
32www.codership.com
Galera Project
API
Galera Replication plugin
API
MariaDB
MySQL Community Edition
MariaDB Galera Cluster
MySQL
Galera Cluster for MySQL
merge
Galera Replication plugin
MySQL
![Page 33: Galera cluster - SkySQL Paris Meetup 17.12.2013](https://reader033.fdocuments.in/reader033/viewer/2022061223/54c6651c4a795928268b456f/html5/thumbnails/33.jpg)
33www.codership.com
Galera Support
CodershipLevel 3 support, Galera
MontyProgramLevel 3 Support, MariaDB
GaleraCluster
MariaDBGaleraCluster
SkySQLSupport Subscriptions