industrial-strength mysql applications using percona and ... · industrial-strength mysql...
TRANSCRIPT
©Continuent 2012.
Industrial-Strength MySQL Applications using Percona
and ContinuentRobert Hodges, CEO Continuent
Peter Zaitsev, CEO Percona
©Continuent 2012
Introducing Continuent
2
• The leading provider of clustering and replication for open source DBMS
• Our Product: Continuent Tungsten
• Clustering - Commercial-grade HA, performance scaling and data management for MySQL
• Replication - Flexible, high-performance data movement
• Optimized for use with Percona Server and XtraBackup
©Continuent 2012
Quick Continuent Facts
• Largest Tungsten clustering installation processes about 500M transactions each day
• Tungsten Replicator was application of the year at the 2011 MySQL User Conference
• Continuent is well known in the MySQL community for its clustering and replication
• Over 80 customers currently deployed
3
©Continuent 2012
Select Continuent Customers
4
©Continuent 2012
Introducing Tungsten Clustering
5
Tungsten clusters combine o!-the-shelf open source DBMS servers into data services with:
• Fast failover• Zero-downtime maintenance • Scaling of load on replicas
...without app changes or data migration
AmazonUS West
apache/php
GonzoPortal.com
Connector Connector
©Continuent 2012
Doesn’t Replication Do This Already?
6
Application
Libmysqlclient.a
Application
Libmysqlclient.a
Replicator
Db2
Replicator
Db3Db1
Replicator
Slave SlaveMaster
©Continuent 2012
Replication Limitations
Replication alone cannot enable constant access to data...
• What happens if the master fails?
• What happens if a slave is lagging too far behind to be usable?
• How do I maintain the DBMS without stopping apps?
7
©Continuent 2012
From Replicating to Clustering
8
Application
Tungsten Connector
Application
Tungsten Connector
Replicator
Db2
Replicator
Db3Db1
Replicator
Slave SlaveMaster
Manager Manager Manager
Monitoring and Control
Monitoring and Control
Data Service: sjc
©Continuent 2012
Automatic Failover
9
Application
Tungsten Connector
©Continuent 2012
Automatic Failover
10
Application
Tungsten Connector
1. Detect non-responsivemaster
2. Halt master connections
©Continuent 2012
Automatic Failover
11
Application
Tungsten Connector
3. Select most advanced slave and wait for pending transactions to apply
©Continuent 2012
Automatic Failover
12
Application
Tungsten Connector
4. Promote to master, reconfigure slave(s), and re-enable connections
©Continuent 2012
Automatic Failover
13
Application
Tungsten Connector
5. Recover failed master
©Continuent 2012
Rolling Schema Upgrade
14
Final UpgradeSwitchSlave Upgrade Slave Upgrade
• Shun slave 1, run upgrade, and return to cluster. Discard and recover on failure
• Upgrade old master. Cluster schema is now fully upgraded
• Repeat for additional slave(s)
• Switch master to promote an upgraded slave
©Continuent 2012
Backup, Recovery, and Restore
15
• Backups
/cluster > datasource DB1 backup
• Recover
/cluster > datasource DB2 recover
• Restore
/cluster > datasource DB2 restore
• Out-of-box support for XtraBackup/mysqldump; simple integration for others
©Continuent 2012
Tungsten Connector Basics
• Any MySQL/PostgreSQL client can connect
• Initiates connections using JDBC
16
App NativeprotocolCOM_QUERY
COM_INIT_DBCOM_DROP_DB
Connector
©Continuent 2012
Tungsten Connector Basics
• Pass-through operation after connection
• Full transparency & low overhead for clients
17
App
Protocol packetCOM_QUERY
select * from t
ConnectorProtocol packet
OKResultSet Rows:1
©Continuent 2012
Read-Write Splitting Options
1. Explicit connection to slave: Let Tungsten pick a replica with minimum latency
2. Simple read-write splitting: Route auto-commit reads to slaves
3. SmartScale: Writers see their own writes but load balance unrelated reads
18
©Continuent 2012
SmartScale Session Load Balancing
19
App
Connect/Write
Connector
TransactionHistory Log
Slavereplay
position
Session xSession y
Slave DBMS
MasterDBMS
Slave DBMS
Initial Write
©Continuent 2012
SmartScale Session Load Balancing
20
AppRead
Connector
TransactionHistory Log
Slavereplay
position
Session xSession y
Slave DBMS
MasterDBMS
Slave DBMS
Read from master
NO read from slave!
©Continuent 2012
SmartScale Session Load Balancing
21
AppRead
Connector
TransactionHistory Log
Slavereplay
position
Session x
Slave DBMS
MasterDBMS
Slave DBMS
Read from master
Read from slave
©Continuent 2012
DEMO!
22
©Continuent 2012
Tungsten Does DR Sites Too!
23
App Server+ Connector
App Server+ Connector
Master Slave
San Jose New York
sj_nyc
©Continuent 2012
How Do I Obtain Tungsten?
24
• Register at Continuent to get clustering downloadshttp://www.continuent.com/downloads/software
• Documentation is available on Continuent website
• Advanced MySQL replication without clustering is available from Tungsten Replicator project on code.google.comhttp://code.google.com/p/tungsten-replicator/
©Continuent 2012
Percona + Continuent = Industrial-Strength
• Percona Server and XtraBackup provide reliable, fast data management
• Tungsten extends Percona to enable 24x7 access and improve resource utilization
• Fast failover
• Zero-downtime maintenance
• SQL load balancing
25
©Continuent 2012.
Contact:http://www.continuent.com
Blog:www.continuent.com/news/blogs
Contact:http://www.percona.com
Blog:www.mysqlperformanceblog.com
Meet us at Percona Live in London and Santa Clara!