Professional Documents
Culture Documents
'Synchronous',
multi-master,
auto-everything
Ulf Wendel, MySQL/Oracle
Proper wording...
An eager update everywhere system based
on the database state machine approach
atop of a group communication system
offering virtual synchrony and
reliable total ordering messaging.
MySQL Group Replication offers
generalized snapshot isolation.
WHAT ?!
Hmm, how does it compare?
Scalability
Geographic distribution
Distribution Transparency
Replication
Concurrency, Failure
Availability
Scalability
Scale on
WAN
Distribution
Transparenc
y
MySQL
Replication
MySQL
Cluster
MySQL
Fabric
Primary =
SpoF,
no auto failover
Shared
nothing,
auto failover
SpoF
monitored,
auto failover
Reads
Partial
replication,
node limit
Partial
replication,
no node limit
Asynchronous
Synchronous
(WAN option)
Asynchronous
(depends)
R/W splitting
SQL: yes
(low level:
no)
Special clients
No distributed
queries
Cluster
Group Repl.
Availability
Shared
nothing,
auto failover
Shared
nothing,
auto
failover/join
Scalability
Partial
replication,
node limit
Full replication,
read and some
write scalability
Synchronous
(WAN option)
(Virtually)
Synchronous
SQL: yes
(low level: no)
Scale on
WAN
Distribution
Transparen
cy
Fabri
c
Scalability
Distribution Transparency
A developers categorization...
Where are transactions run?
Eage
r
When does
synchronizati
on happen?
Primary Copy
Update Everywhere
(MySQL semisynch
Replication)
MySQL Cluster
MySQL Group
3rd party: Galera
MySQL
Replication/Fabri
Lazy
c
3rd party:
Tungsten
MySQL Cluster
Replication
010101001011010
101010110100101
101010010101010
101010110101011
101010110111101
Node
Node
Node
price = 1.00
price = 1.23
price = 0.98
Write
Primary
Copy
Copy
Copy
Read
Read
Read
Write
Node
price = 1.23
price = 1.23
price = 1.23
Node
Node
Write
Read
Write
Read
trivial to understand
Atomic Broadcast
Replica
Replica
Replica
Output
Output
Output
A=1
A=1
A=1
Requirement: Agreement
Input
Set A = 1
Replica
Replica
Output
A = NULL
A=1
Replica
Requirement: Order
1) Set A = 1
2) Set B = 1
3) Set B = A *2
Input: 1, 2, 3
Input: 1, 3, 2
Input: 3, 1, 2
Replica
Replica
Replica
A=1
A=1
A=1
B=2
B=1
B=1
Atomic Broadcast
Distributed systems messaging abstraction
Agreement
Order
Termination
Replica
Replica
Replica Group
Replica
Replica
Mr. X
Send first, possibly delivered second
Client Response
Replica
Agreement
Replica
Execution
Replica
Server Coordination
Client
Client Request
Client
Replica
Replica
Replica
Replica
Replica
Execution
Replica
Client
Client
Replica
Replica
Replica
Client
Primary
Backup
Backup
Primary replies to client
Passive Replication
Client
Replica
Replica
Replica
Client
Primary
Transaction processing
Primary
Primary
Transaction termination
Read
Write
Primary
Primary
Rs/Ws/U
Primary
Primary
MySQL
Plugin Services
Plugins
Transaction hooks
Capture
Apply
Recover
What's concurrent?
Any other transaction that precedes the current
one
Replica
Total order
Replica
1
2
1
R
2
Replica
Total order
Replica
R
4
Certification
TIME TO BREATH
MySQL is different anyway...
BEGIN COMMIT
Replica Execute
t(3)
Result
Certify
R
Replica
Certify
Apply
MySQL Replication
Client
BEGIN COMMIT
Master execute
OK
R
Slave
Fetch
Apply
BEGIN COMMIT
Master Execute
OK
R
Fetch
Slave
Slave
Fetch
Apply
Apply
Back to theory!
Virtual Synchrony?
Virtual Synchrony
Groups and views
P1
M1
P2
P3
M3
M2
P4 VC
G1 = {P1, P2, P3}
M4
G2 = {P1, P2, P3, P4}
Virtual Synchrony
View changes act as a message barrier
P1
P2
P3
P4
VC
M5
M6
M8
M7
Auto-everything: failover
MySQL Group Replication has a pluggable GCS API
MySQL
MySQL
MySQL
MySQL
MySQL
MySQL
Auto-everything: joining
Elastic cluster grows and shrinks on demand
Donor
State transfer
MySQL
MySQL
MySQL
MySQL
MySQL
MySQL
Joiner
Back to theory!
Generalized Snapshot Isolation
Read
Write
Primary
Primary
V/Ws/U
Primary
Primary
Snapshot Isolation
Concurrent and write conflict? First comitter wins!
First committer
T1
T2
T2
Write(v2, x=1)
R
Certification
Replica
Object
Latest version
13
OK
Hmm...
Does it work?
InnoDB only
Isolation level
No concurrent DDL
MySQL
Corosync
MySQL
MySQL
Corosync
Corosync
THE END
Contact: ulf.wendel@oracle.com