Built-in MySQL Replication is known for its capability to enable to scale reads easily. However, there are some limitations and known issues with this solution because of the asynchronous nature of this replication. This talk will describe another way of doing MySQL replication, by using synchronous...
Built-in MySQL Replication is known for its capability to enable to scale reads easily. However, there are some limitations and known issues with this solution because of the asynchronous nature of this replication. This talk will describe another way of doing MySQL replication, by using synchronous replication, available in Percona XtraDB Cluster. The open source solution will be explained and compared to traditional asynchronous MySQL replication, as well as some known use cases will be described. Percona XtraDB Cluster is an, open source, high availability and high scalability solution for MySQL clustering. Features include: Synchronous replication, Multi-master replication support, Parallel replication, Automatic node provisioning.
41Traditional&InnoDB&Locking
system 1
Transaction 1
Transaction 2
BEGIN
Transaction1
BEGIN
UPDATE t WHERE id=14
UPDATE t WHERE id=14
...
COMMIT
Waits on COMMIT in trx 1
42Traditional&InnoDB&Locking
system 1
Transaction 1
Transaction 2
BEGIN
Transaction1
BEGIN
UPDATE t WHERE id=14
UPDATE t WHERE id=14
...
COMMIT
DML,COMMIT or SELECT
ERROR due row conflict
system 2
...
43Traditional&InnoDB&Locking
system 1
Transaction 1
Transaction 2
BEGIN
Transaction1
BEGIN
UPDATE t WHERE id=14
UPDATE t WHERE id=14
...
COMMIT
COMMIT
ERROR due row conflict
system 2
...ERROR 1213 (40001): Deadlock found when trying
to get lock; try restarting transaction
60WAN&replication
MySQL
MySQL
MySQL
•No%impact%on%reads%
•No%impact%within%a%trx%
•Communication%only%happens%during
COMMIT%(or%if%autocommit=1)%
•Use%higher%timeouts%and
send%windows
•Beware%of%increased%latency%
•Within%EUROPE%EC2%
•COMMIT:%0.005100%sec%
•EUROPE%<c>%JAPAN%EC2%
•COMMIT:%0.275642%sec
61WAN&replication&P&latency
MySQL
MySQL
MySQL
62
WAN&replication&with&MySQL&asynchronous&
replication
MySQL
MySQL
MySQL
•You%can%mix%both%types%of%replication%
•Good%option%on%slow%WAN%link%
•Requires%more%nodes%
•If%binlog%position%is%lost,%
full%cluster%must%be%
reprovisioned%(*)
MySQL
MySQL
MySQL
MySQL
MySQLMySQL