galera cluster - skysql paris meetup 17.12.2013
DESCRIPTION
Galera cluster - Sakari Keskitalo at the SkySQL Paris Meetup 17.12.2013TRANSCRIPT
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.
2www.codership.com
What is the Meaning of Galera ?
Turns out it has different semantics in:● Italy● Uruguay● Brazil● Spain, Portugal, Russia...
3www.codership.com
Galera in Italy
Che cosa significa la parola galera?
Jail / Prison
4www.codership.com
Galera in Uruguay
Que significaca galera en Uruguai?
Traditional tall hat
5www.codership.com
Galera in Brazil
A Group of Happy People
7www.codership.com
Galera in Spain, Portugal, Russia...
Galley
8www.codership.com
Asynchronous Replication
Can be a mess....
9www.codership.com
Synchronous Replication
That's more like it !!
10www.codership.com
MariaDB
Synchronous Multi-Master Replication
Galera Replication
11www.codership.com
MariaDB MariaDB
Synchronous Multi-Master Replication
Galera Replication
There can be several nodes
12www.codership.com
MariaDB MariaDB MariaDB
Synchronous Multi-Master Replication
Galera Replication
There can be several nodes
Nodes can be added on the fly
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
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
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
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
17www.codership.com
MariaDB MariaDB MariaDB
Synchronous Replication
aGalera Replication
Read & write
Transaction is processed locally up to commit time
18www.codership.com
MariaDB MariaDB MariaDB
Synchronous Replication
Galera Replication
commit
Transaction's write set is replicated to whole cluster
Slave queueSlave queue
19www.codership.com
Galera Replication
MariaDB MariaDB MariaDB
Synchronous Replication
OK
Client gets OK status
Slave queueSlave queue
20www.codership.com
Galera Replication
MariaDB MariaDB MariaDB
Synchronous Replication
Transaction is applied in slaves
Slave queueSlave queue
21www.codership.com
MariaDB MariaDB MariaDB
How node failures are handled
a
Galera Replication
Load Balancing
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
23www.codership.com
Galera ReplicationA
Optimistic Concurrency Control
commit
Trx A
B
commit
Trx B
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
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
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
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
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
29
Who is using Galera?
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.
31www.codership.com
Galera Project
MySQL
MariaDBmerge
merge
MySQL Community Edition
MariaDBGalera Cluster for MySQL
MariaDB FeaturesAPI
MySQL
Galera Replication plugin
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
33www.codership.com
Galera Support
CodershipLevel 3 support, Galera
MontyProgramLevel 3 Support, MariaDB
GaleraCluster
MariaDBGaleraCluster
SkySQLSupport Subscriptions
More info www.codersip.com